From Multi Theft Auto: Wiki
Revision as of 04:39, 11 August 2019 by Danilo (talk | contribs)

This function sets the server's gravity level.

[[{{{image}}}|link=]] Note:
  • This does not effect peds/players; to set ped/player gravity use setPedGravity.
  • Setting the gravity level to different values on clients can cause animation bugs (players floating across ground because players see different fall animation.)


bool setGravity ( float level )

Required Arguments

  • level: The level of gravity (default is 0.008).


Returns true if gravity was changed, false otherwise.


function grav ( sourcePlayer, command, level )
    local level = tonumber(level)
    if (not level) then return end
    setGravity ( tonumber(level) )
addCommandHandler ( "setgravity", grav )

See Also