GetObjectScale

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This function returns the visible size of an object.

Syntax

float, float, float getObjectScale ( object theObject )

OOP Syntax Help! I don't understand this!

Method: Object:getScale(...)
Variable: .scale
Counterpart: setObjectScale


Required Arguments

  • theObject: the object you wish to return the scale of.

Returns

  • Three float values indicating the scale of the object on the x, y, and z axis if successful, false otherwise.

Example

Click to collapse [-]
Client-only Example

This example adds a command named getscale which creates an object and prints out the scale of it.

addCommandHandler("getscale",
    function()
	local theObject = createObject(1337, getElementPosition(localPlayer))
	local x, y, z = getObjectScale(theObject)
	outputChatBox("Object scale: X: "..x..", Y: "..y.." Z: "..z.."")
    end
)

See Also