GetObjectMass: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(OOP) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Client_function}} | ||
{{New feature/item|3.0132|1.3.2|5170| | {{New feature/item|3.0132|1.3.2|5170| | ||
This function returns the mass of a specified object. | This function returns the mass of a specified object. | ||
Line 9: | Line 9: | ||
float getObjectMass ( object theObject ) | float getObjectMass ( object theObject ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[object]]:getMass|mass|SetObjectMass}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theObject:''' | *'''theObject:''' the object whose mass you want to get. | ||
===Returns=== | ===Returns=== | ||
* A [[float]] representing the mass of the object. | |||
* ''false'' if invalid arguments were passed. | |||
==Example== | ==Example== |
Revision as of 23:10, 4 October 2014
This function returns the mass of a specified object.
Syntax
float getObjectMass ( object theObject )
OOP Syntax Help! I don't understand this!
- Method: object:getMass(...)
- Variable: .mass
- Counterpart: SetObjectMass
Required Arguments
- theObject: the object whose mass you want to get.
Returns
- A float representing the mass of the object.
- false if invalid arguments were passed.
Example
This script basically creates an object then get's the mass and set's its mass 300 more than it's original mass, then tell the client the old and new mass of the object.
local object = createObject(1337,0,0,3) local oldMass = getObjectMass(object) local newMass = oldMass+300.0 setObjectMass(object,newMass) outputChatBox("Object Old Mass: "..oldMass..", New Mass: "..newMass)
See Also
- createObject
- getObjectScale
- moveObject
- setObjectScale
- stopObject
- getObjectMass
- getObjectProperty
- setObjectMass
- setObjectProperty