Skip to main content

Ability

Ability is a global enum that represents the different abilities in JC4MP, such as the grappling hook, wingsuit, etc.

AbilityDescription
Ability.TetherAllows the player to connect two objects or players together with the grapplehook.
Ability.RetractTetherAllows the player to pull tethered objects or players towards each other.
Ability.WingsuitAllows the player to use the wingsuit.
Ability.PlantedExplosivesAllows placement of explosives that can be detonated remotely.
Ability.ParachuteAllows the player to use the parachute.
Ability.ParachuteSlingshotAllows the player to use the grapplehook while parachuting.
Ability.GrapplingHookControls whether or not the grappling hook is enabled.
Ability.HammerAllows the player to use the grapplehook melee ability.
Ability.MultiplePlantedExplosivesEnables placement of multiple explosives simultaneously.
Ability.GrenadesAllows the player to use grenades.
Ability.ExitVehicleAllows the player to quickly exit any vehicle.

Example of enabling the local player's ability to use the wingsuit:

Event.Add("ResourceStart", function(name)
local localPlayer = Players.Local():GetGamePlayer()
localPlayer:EnableAbility(Ability.Wingsuit)
end)

Make sure to enable abilities once the resource has loaded. In this example, it's using the ResourceStart event to ensure that the resource has fully loaded before enabling the ability. If the ability were enabled outside of this event, it might not trigger properly right when a player joins the server.