getObjectMass | Multi Theft Auto: Wiki Skip to content

getObjectMass

Client-side
Server-side
Shared

Pair: setObjectMass

Manual Review Required

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


This function returns the mass of a specified object.

OOP Syntax Help! I don't understand this!

  • Method:object:getMass(...)
  • Variable: .mass

Syntax

float getObjectMass ( object theObject )
Required Arguments
  • theObject: the object whose mass you want to get.

Returns

  • float: value

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.

Code Examples

shared

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)