isObjectMoving | Multi Theft Auto: Wiki Skip to content

isObjectMoving

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 checks if an object is moving.

Syntax

isObjectMoving ( )

Code Examples

server

This example creates an object when the resource starts and checks if the object is moving:

addEventHandler ("onClientResourceStart", resourceRoot,
function ()
local x, y, z = getElementPosition (localPlayer)
object = createObject (1239, x, y, z)
moveObject (object, 5000, x, y, z + 5)
end
)
addCommandHandler ("getmoving",
function (commandName)
outputChatBox ("Is object "..(isObjectMoving(object) and "moving" or "not moving"))
end
)