Calling this function will asynchronously get and return information about this player's regions as SUserRegions. (This is the same information in the "Region List" window).
--Make's a UIText show this Grid's current Subscription TiertextObject = Space.Host.GetReference("TheTextReference") --add to References section in Scripting RuntimefunctionGetUserRegionsComplete(SUserRegions)local r = SUserRegions.SubscriptionTier text.UIText.Text = rendSpace.Grid.GetEnabledUserRegions(GetUserRegionsComplete)
Returns the Region Texture (the image seen while loading the region) as a resource. This function requires an SPublicRegion object to identify which region. (white-label grids only)
Parameter
Type
Description
Space.Grid.GetRegionTexture(AnSPublicRegionObject,OnCompleteFunction)--see below example
--When this object is clicked, it's material becomes the Region Texture of the user's first regionthisObject = Space.Host.ExecutingObjectfunctionGetTextureComplete(textureResource) thisObject.Renderer.Material.SetTexture("_MainTex",textureResource)endfunctionGetUserRegionsComplete(SUserRegions) r = SUserRegions.AvailableRegions Space.Grid.GetRegionTexture(r[1],GetTextureComplete)endfunctionOnClickFunction()Space.Grid.GetEnabledUserRegions(GetUserRegionsComplete)endthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)
GetOutfits
void GetOutfits (Closure onComplete)
Calling this function will asynchronously get and return information about this player's outfits as a List of SOutfit.
--Clicking this object will turn it green color if this grid is white-label--and will turn it red color if notthisObject = Space.Host.ExecutingObjectfunctionOnClickFunction()if Space.Grid.IsWhiteLabel then thisObject.Renderer.Material.SetColor("_Color",Color.Green)else thisObject.Renderer.Material.SetColor("_Color",Color.Red)endendthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)
PlayerIsAdmin
bool PlayerIsAdminget
Returns true if this player's Grid role is Admin.(white-label grid only)
isAdmin = Space.Grid.PlayerIsAdmin
--Clicking this object will turn it green color if your grid role is Admin--and will turn it red color if notthisObject = Space.Host.ExecutingObjectfunctionOnClickFunction()if Space.Grid.PlayerIsAdmin then thisObject.Renderer.Material.SetColor("_Color",Color.Green)else thisObject.Renderer.Material.SetColor("_Color",Color.Red)endendthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)
PlayerIsModerator
bool PlayerIsModeratorget
Returns true if this player's Grid role is Moderator. (white-label grid only)
isModerator = Space.Grid.PlayerIsModerator
--Clicking this object will turn it green color if your grid role is Moderator--and will turn it red color if notthisObject = Space.Host.ExecutingObjectfunctionOnClickFunction()if Space.Grid.PlayerIsModerator then thisObject.Renderer.Material.SetColor("_Color",Color.Green)else thisObject.Renderer.Material.SetColor("_Color",Color.Red)endendthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)
PlayerIsDeveloper
bool PlayerIsDeveloperget
Returns true if this player's Grid role is Developer.(white-label grid only)
isDeveloper = Space.Grid.PlayerIsDeveloper
--Clicking this object will turn it green color if your grid role is Developer--and will turn it red color if notthisObject = Space.Host.ExecutingObjectfunctionOnClickFunction()if Space.Grid.PlayerIsDeveloper then thisObject.Renderer.Material.SetColor("_Color",Color.Green)else thisObject.Renderer.Material.SetColor("_Color",Color.Red)endendthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)
PlayerIsTrusted
bool PlayerIsTrustedget
Returns true if this player's Grid role is Trusted.(white-label grid only)
isTrusted = Space.Grid.PlayerIsTrusted
--Clicking this object will turn it green color if your grid role is Trusted--and will turn it red color if notthisObject = Space.Host.ExecutingObjectfunctionOnClickFunction()if Space.Grid.PlayerIsTrusted then thisObject.Renderer.Material.SetColor("_Color",Color.Green)else thisObject.Renderer.Material.SetColor("_Color",Color.Red)endendthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)
The viewer's theme consist of 4 Theme Colors and 2 Text Colors.
textColor2 = Space.Grid.TextColor2
Name
string Nameget
Returns the Grid's Name. (white-label grid only)
gridName = Space.Grid.Name
--Clicking this object will populate a UIText field with the current Grid's NamethisObject = Space.Host.ExecutingObjecttextObject = Space.Host.GetReference("TheTextReference")functionOnClickFunction()local gridName = Space.Grid.NametextObject.UIText.Text = gridNameendthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction
SiteURL
string SiteURLget
Returns the Grid's Site URL. (white-label grid only)
siteUrl = Space.Grid.SiteURL
--Clicking this object will populate a UIText field with the current Grid's Site URLthisObject = Space.Host.ExecutingObjecttextObject = Space.Host.GetReference("TheTextReference")functionOnClickFunction()local siteURL = Space.Grid.SiteURLtextObject.UIText.Text = siteURLendthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction
DefaultRegion
int DefaultRegionget
Returns the Region ID of the Default Region. The Default Region is set in the grid's Dashboard. (white-label grid only)
defaultRegion = Space.Grid.DefaultRegion
--Clicking this object will teleport the user to the grid's Default RegionthisObject = Space.Host.ExecutingObjectfunctionOnClickFunction()local defaultRegion = Space.Grid.DefaultRegion Space.PlayerAvatar.Teleport(defaultRegion)endthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)
Avatars
int[] Avatarsget
Returns the IDs of all Avatars in the grid. (white-label grid only)
avatars = Space.Grid.Avatars
--Clicking this object will populate a UIText field with the current Grid's AvatarsthisObject = Space.Host.ExecutingObjecttextObject = Space.Host.GetReference("TheTextReference")functionOnClickFunction()local avatars = Space.Grid.Avatars av = json.serialize(avatars) textObject.UIText.Text = avendthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)
OrientationRegion
int OrientationRegionget
Returns the Region ID of the "Orientation Region".
orientationRegion = Space.Grid.OrientationRegion
--Clicking this object will teleport the user to the grid's Orientation RegionthisObject = Space.Host.ExecutingObjectfunctionOnClickFunction()local orientationRegionRegion = Space.Grid.OrientationRegion Space.PlayerAvatar.Teleport(orientationRegion)endthisObject.AddClickable()thisObject.Clickable.OnClick(OnClickFunction)