Character abilities¶
CharacterAbilities has four abilities, numbered 1 to 4, that a server
script sets on a character. Ability n fires on the tick one of the
Action<n> bits turns on in
CharacterMoveIntent.ActionBits:
Velocity<n>is the velocity in units per second in the character's own space: X to its right, Y up, and -Z where it faces. WhenAdd<n>is true, it adds to the character's velocity instead of replacing it.Hold<n>, when true, fires the ability on every tick a bit stays on.Cooldown<n>is the number of physics ticks, 60 a second, before the ability fires again.States<n>lists theStatevalues it fires in, one bit per state number; 0 fires in every state. No ability fires while the character is seated or knocked down.
-- Server script under scripts/autorun/: action bit 1 launches up and forward.
Component.Character.Added:Connect(function(character: Entity)
character:Add(Component.CharacterAbilities)
local abilities = character.CharacterAbilities
if abilities then
abilities.Action1 = 1
abilities.Velocity1 = Vector3.new(0, 50, -30)
abilities.Cooldown1 = 30
end
end)