Skip to content

setPedWearingJetpack

Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function is used to give or take a jetpack from a ped, it won't work if the ped is in a vehicle.

OOP Syntax Help! I don't understand this!

  • Method:ped:setWearingJetpack(...)
  • Variable: .jetpack

Syntax

bool setPedWearingJetpack ( ​ped thePed, ​bool state )
Required arguments
  • thePed: The ped you want to give a jetpack to.
  • state: A boolean representing whether to give or take the jetpack.

Returns

Returns true if a jetpack was successfully set for the ped, false if setting it failed.

  • bool: value

Code Examples

shared

This examples adds a "jetpack" console command, which toggles a jetpack for the player.

addCommandHandler ( "jetpack",
function ( player )
setPedWearingJetpack ( player, not isPedWearingJetpack ( player ) )
end
)

See Also