ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Shared functions
  3. getModelBoundingBox

Function

getModelBoundingBox

Server and clientWorldTrilogy Hub only

Returns a model's dimensions without creating an element: the minimum and maximum x, y, z relative to its centre (from the game's collision) and the radius. The server asks a player's game, so inside async it waits up to 1.5 s and remembers the result.

Syntax

float, float, float, float, float, float, float getModelBoundingBox(int model)

Arguments

modelint
The model id.

Returns

minX, minY, minZ, maxX, maxY, maxZ, radius; false for an unknown model or with no players (server).

Example

local minX, minY, minZ, maxX, maxY, maxZ = getModelBoundingBox(411)
outputChatBox(("Długość: %.2f m"):format(maxY - minY))

See also