Skip to main content

Ability

Ability holds the local player's unlockable abilities: the grappling hook, tethers, the wingsuit, the parachute and so on. Use it to take gear away from players (for example no wingsuit in a race) or to give it back.

Available on: Client

Values​

Ability​

Each value is a 32-bit hash of the game's ability name (shown in the second column).

Used by (see Local):

  • Local.LockAbility(ability): the local player can no longer use the ability.
  • Local.UnlockAbility(ability): the local player can use the ability again.
  • Local.IsAbilityUnlocked(ability): true while the local player can use it.

These only affect the local player's game and are not synced. To lock an ability for everyone, do it in every client (for example from a server event sent to all players).

NameGame abilityMeaning
Ability.Tetherability_dual_tetherTethering: attaching two things together with the grappling hook.
Ability.RetractTetherability_retract_tetherRetracting tethers (pulling the two tethered things together).
Ability.Wingsuitability_wingsuitThe wingsuit.
Ability.PlantedExplosivesability_planted_explosivesPlanting explosives.
Ability.Parachuteability_parachuteThe parachute.
Ability.ParachuteSlingshotability_parachute_slingshotThe parachute slingshot (being pulled along by the grapple while under the parachute).
Ability.GrapplingHookability_grappling_hookThe grappling hook.
Ability.Hammerability_hammerThe hammer ability.
Ability.MultiplePlantedExplosivesability_multiple_planted_explosivesHaving more than one planted explosive out at the same time.
Ability.Grenadesability_grenadesThrowing grenades.
Ability.ExitVehicleability_exit_vehicleGetting out of a vehicle.

Example

-- client: no wingsuit and no parachute during a race, given back when it ends
Net.AddEvent("raceStarted", function()
Local.LockAbility(Ability.Wingsuit)
Local.LockAbility(Ability.Parachute)
end)

Net.AddEvent("raceEnded", function()
Local.UnlockAbility(Ability.Wingsuit)
Local.UnlockAbility(Ability.Parachute)

print("wingsuit unlocked: " .. tostring(Local.IsAbilityUnlocked(Ability.Wingsuit)))
end)