- Documentation
- Server functions
- setPedGravity
Function
setPedGravity
Stores the gravity of a single ped (0.008 by default, the same as world gravity). In Trilogy Hub this is state for scripts returned by getPedGravity; only the whole world's gravity set with setGravity affects how peds move.
Syntax
bool setPedGravity(ped ped, float value)Arguments
pedped- A player or an NPC.
valuefloat- Gravity (0.008 = normal).
Returns
true on success.
Example
setPedGravity(player, 0.004)
Notes
State for scripts. Gravity that works in the game is changed with setGravity.
See also
getPedGravityReturns the ped gravity stored withsetPedGravity(0.008 by default).setGravityChanges the gravity strength in the game world for every player. The default is 0.008; a smaller value gives higher jumps and longer car flights (e.g. 0.004 = half of Earth's). The game accepts values above 0 and below 1.