IsObjectMoving: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Add missing OOP info) |
||
| Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool isObjectMoving ( object theObject )</syntaxhighlight> | <syntaxhighlight lang="lua">bool isObjectMoving ( object theObject )</syntaxhighlight> | ||
{{OOP||[[object]]:isMoving|moving}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theObject:''' The [[object]] | *'''theObject:''' The [[object]] | ||
Revision as of 07:23, 17 August 2021
This function checks if an object is moving.
Syntax
bool isObjectMoving ( object theObject )
OOP Syntax Help! I don't understand this!
- Method: object:isMoving(...)
- Variable: .moving
Required Arguments
- theObject: The object
Returns
- true if the object is moving.
- false if the object is not moving.
Example
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(cmd)
outputChatBox("Is object "..(isObjectMoving(object) and "moving" or "not moving"))
end
)
Requirements
This template will be deleted.
See Also
- createObject
- getObjectScale
- moveObject
- setObjectScale
- stopObject
- getObjectMass
- getObjectProperty
- setObjectMass
- setObjectProperty