From Multi Theft Auto: Wiki
Jump to navigation Jump to search

This function gets the radius of an element. Normally, sphere or circle-shaped elements tend to return a more accurate and expected radius than others with another shapes.


float getElementRadius ( element theElement )

OOP Syntax Help! I don't understand this!

Method: element:getRadius(...)
Variable: .radius

Required Arguments


Returns a float containing the radius if the element is valid, false otherwise.


This example shows how to get and output the radius of every player who types the /getmyradius command (which will always be 1).

local function outputLocalPlayerRadius()
    outputChatBox("Your radius is " .. getElementRadius(localPlayer))
addCommandHandler("getmyradius", outputLocalPlayerRadius)

See Also