Skip to main content

Session

Contains functions for interacting with sessions.

info

This module can only be used in Entity scripts.

Properties

isEvent

Indicates whether the active session is part of an event. This property is read-only.

Functions

getProperty(key)

Gets the custom property for the session with the specified key.

Parameters

  • key The key of the property to get.

Returns

The value of the property, or nil if the property does not exist.


getAllProperties()

Gets all custom properties for the session.

Returns

A table containing all properties for the session.


captureSnapshot(targetPlayer, position, rotation)

Sends a request to capture a snapshot of the specified target player.

Parameters

  • targetPlayer The Player or client ID of the target player.
  • position Local camera offset relative to the target player.
  • rotation Local rotation offset. With zero rotation camera orientation will match the player.

enableSnapshotMetadata(enable)

Enables metadata to be included with Session snapshots. Allows the World's owner to use the snapshot as a Cover Image.

Parameters

  • enable If metadata should be included. Only applies if the world owner is the snapshot's target.

checkIsEventHost(targetPlayer)

Checks if the specified player is the host of the event.

Parameters

  • targetPlayer The Player or client ID of the target player.

Returns

A boolean indicating whether the player is the host of the event.