Placers

The Placers library lets players position objects in the world using a placement preview system. Two approaches are available: a simple one-shot helper (Placeable) and a more controllable object-based API (PlaceableObject).

Side: Client


Placeable (Simple API)

PlaceObject

Starts an interactive object placement session. The player sees a ghost preview of the object and can position it with the mouse. Returns the final coordinates once the player confirms placement, or nil if cancelled.

local coords = Bridge.Placeable.PlaceObject(object, distance, snapToGround, allowedMats, offset)
-- Returns: vector3 | nil
ParameterTypeDescription
objectstring | numberModel name or hash of the object to place
distancenumberMaximum placement distance from the player
snapToGroundbooleanIf true, the preview snaps to the ground surface
allowedMatstableTable of allowed material hashes (placement only valid on these surfaces)
offsetvector3Offset applied to the preview object position

StopPlacing

Cancels the current placement session started by PlaceObject.

Bridge.Placeable.StopPlacing()

PlaceableObject (Advanced API)

Provides finer control with start/stop lifecycle, mode querying, and entity access.

Create

Creates a new placeable object session with configurable settings. Does not block ďż˝ use events or polling with IsPlacing to detect completion.

PlaceableObject.Create(model, settings)
ParameterTypeDescription
modelstring | numberModel name or hash
settingstablePlacement settings (see below)

Settings fields:

FieldTypeDescription
distancenumberMaximum placement distance
snapToGroundbooleanSnap to ground surface
allowedMatstableAllowed material hashes
offsetvector3Position offset for the preview

Stop

Cancels the active PlaceableObject session.

PlaceableObject.Stop()

IsPlacing

Returns whether a placement session is currently active.

local placing = PlaceableObject.IsPlacing()
-- Returns: boolean

GetCurrentEntity

Returns the entity handle of the preview object being placed.

local entity = PlaceableObject.GetCurrentEntity()
-- Returns: number | nil

GetCurrentMode

Returns the current interaction mode of the placement session.

local mode = PlaceableObject.GetCurrentMode()
-- Returns: string | nil