Skip to content

Player:GetSelectedObjects

Read selected objects for this player.

player:GetSelectedObjects()

Inputs: None beyond the Player receiver.

Output: Object array or nil, reason. Complete local selection in native order, including objects owned by other players. Empty selection returns an empty array. Unavailable or changing selection returns nil and a reason. Only callable for the local player.

Errors and unavailable states: A wrong receiver can raise a Lua argument error. A nonlocal player, unavailable layout, or changing selection returns nil, reason; an empty array means a successfully read empty selection.

See Lua values and game objects for lifetime and enum guidance.