getGravity | Multi Theft Auto: Wiki Skip to content

getGravity

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

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


This function returns the current gravity level for the context in which it is called (server or client).

Syntax

getGravity ( )

Code Examples

server

This serverside command outputs the serverside gravity level.

function getGravityLevel( playerSource )
local gravity = getGravity ( )
outputConsole ( "The gravity is currently set to " .. gravity, playerSource )
end
-- attach the 'getGravityLevel' function to the "gravity" command
addCommandHandler ( "gravity", getGravityLevel )

See Also

World Functions