CharacterManager
Manager module for character-related things such as collisions, damage bricks, and boosts.
Currently, the valid types for Boosters and Boost Pads are:
Speed
for WalkSpeedJump
for JumpPower
Types
BoostData
interface
BoostData {
isPad:
boolean
startTime:
number
mode:
string
type:
string
power:
number
duration:
number
timerDecimals:
boolean
hideGUI:
boolean
startTweenInfo:
TweenInfo
endtweenInfo:
TweenInfo
infinite:
boolean
multiplier:
number
timeLeft:
number
}
Functions
ValidateDamageBrick
Function internally used to validate a damage brick's damage value. This also checks whether the damage brick is deactivated or not.
Damage
Fires the DamageEvent with the given damage
value.
damage
can be either a number
, or a string
representing a key in the
VALID_DAMAGEBRICKS
table.
GetHumanoid
Returns the player
's Humanoid
if it exists.
GetActiveBoost
CharacterManager:
GetActiveBoost
(
boostType:
string
,
isPad:
boolean?
) →
_TDefs.BoostData?
Get a currently active boost with the given boostType
.
If isPad
is true, it will return the currently active boost pad. Otherwise,
it will return the currently active regular boost.
IsBoostInfinite
CharacterManager:
IsBoostInfinite
(
boostData:
_TDefs.BoostData
) →
boolean
Returns whether a given boost should be infinite or not. Boosts with a duration of 0 or below, or higher than 10^10 are considered infinite and will never run out unless removed by a boost remover.
StartBoost
CharacterManager:
StartBoost
(
boostData:
_TDefs.BoostData
) →
(
)
Starts a boost with the given boost data. If a boost with the given type is already active, the already active boost will be refreshed instead of a new boost being started.
UpdateBoost
CharacterManager:
UpdateBoost
(
boostData:
_TDefs.BoostData
,
boostEnded:
boolean?
) →
(
)
Updates the given boost, updating the affected property.
If boostEnded
is true
, the character will return to it's default properties
rather than using the boost's power.
RemoveBoost
CharacterManager:
RemoveBoost
(
boostData:
_TDefs.BoostData
) →
(
)
Ends the given boost.
GetActiveBoosts
CharacterManager:
GetActiveBoosts
(
) →
{
_TDefs.BoostData
}
Returns a table containing the currently active boosts.