LogoLogo
Scripting DocsSupport
Scripting
Scripting
  • Sinespace Scripting Documentation
  • Client Scripting
    • Viewer
      • SDialogues
      • SInput
      • SShared
      • SUI
    • Network
      • SChat
      • SNetwork
      • SPhotos
      • SVideos
      • SWebService
    • Player
      • SEconomy
      • SGroup
      • SInventory
      • SProfile
      • SQuests
    • Region
      • SCameraManager
      • SGrid
      • SHost
      • SPersistence
      • SPhysics
      • SPostFX
      • SScene
      • SScript
      • SRenderSettings
    • Components
      • SAnimation
      • SAnimator
      • SAudioReactiveAnimation
      • SAudioReactiveBase
      • SAudioReactiveLight
      • SAudioReactiveMaterial
      • SAudioReactiveParticleSystem
      • SAudioReactiveTransform
      • SAudioSource
      • SBoxCollider
      • SBrowserSurface
      • SCamera
      • SCanvasGroup
      • SCapsuleCollider
      • SCharacterController
      • SClickable
      • SCloth
      • SCollider
      • SContentSizeFitter
      • SEmbeddedVideo
      • SEventCalendar
      • SFurniture
      • SGraphicRaycaster
      • SHingeJoint
      • SLight
      • SLineRenderer
      • SMeshRenderer
      • SModularVehicle
      • SNavMeshAgent
      • SNavMeshObstacle
      • SNetworking
      • SParticleSystem
      • SPlayableDirector
      • SPostProcessVolume
      • SRectTransform
      • SReflectionProbe
      • SRenderer
      • SRigidbody
      • SRoomFloor
      • SSceneBackgroundMusic
      • SScriptingData
      • SScriptingEvents
      • SScriptingResources
      • SScriptingRuntime
      • SSeat
      • SSkinnedMeshRenderer
      • SSphereCollider
      • SStateMachine
      • STerrain
      • STrailRenderer
      • SUIButton
      • SUICanvas
      • SUIDropdown
      • SUIImage
      • SUIInputField
      • SUILayout
      • SUIRawImage
      • SUIScrollbar
      • SUISlider
      • SUIText
      • SUIToggle
      • SUIToolTipHint
      • SVirtualCamera
      • SVoiceZone
    • Types
      • SAnimationState
      • SAnimatorStateInfo
      • SAvatar
      • SAvatarAppearance
      • SChatMessage
      • SColor
      • SCommandBuffer
      • SDateTime
      • SGameObject
      • SGenre
      • SGroupInfo
      • SInventoryItem
      • SJointLimits
      • SJointMotor
      • SJointSpring
      • SLandmark
      • SLayerMask
      • SMaterial
      • SMath
      • SMusicDirectory
      • SMusicStation
      • SMusicStationList
      • SNetworkMessageLua
      • SOutfit
      • SParticle
      • SPhysicsHit
      • SPublicRegion
      • SQuaternion
      • SRay
      • SRect
      • SResource
      • SScore
      • SScoreRank
      • SString
      • SSubRegion
      • STrackInfo
      • STuneIn
      • SUIRaycastResult
      • SUserRegions
      • SVector
      • SUserProfile
      • SSocialMedia
      • SWebResponse
  • Server Scripting
    • Library
      • SMath
    • Network
      • SShared
      • SWebservice
    • Region
      • SAvatar
      • SCell
      • SObject
      • SParcel
      • SParcelManager
      • SRegionScript
      • SScene
    • Storage
      • SDatabase
  • Guides
    • Persistence
    • Server Scripts
  • Sample Projects
    • Smart Lights
    • Trivia Box
  • Changelog
    • API Changelog
  • Support
    • Report An Issue
Powered by GitBook

Sinespace® is a registered trademark of Sine Wave Entertainment Ltd, All Rights Reserved.

On this page
  • Index
  • Functions Index
  • Functions
  • UpdateInfo
  • RetrieveValue
  • SetValue
  • UpdateRegionInfo
  • RetrieveRegionValue
  • SetRegionValue

Was this helpful?

Export as PDF
  1. Client Scripting
  2. Region

SPersistence

Index

Functions Index

Function Name

Functions

UpdateInfo

void UpdateInfo (Closure onComplete)

Call the onComplete function upon the server saving a value.

Parameter
Type
Description

function OnCompleteFunction()
--
end

Space.Persistence.UpdateInfo(OnCompleteFunction)
Space.Persistence.SetValue("TestValue","123");

Space.Persistence.UpdateInfo(function ()
    local value = Space.Persistence.RetrieveValue("TestValue")
    Space.Log(value)
end)
--print "123" to console.

RetrieveValue

string RetrieveValue (string key)

Returns the saved value with the key.

Parameter
Type
Description

Space.Persistence.RetrieveValue("TestValue")

SetValue

void SetValue (string key, string value)

Save a value to the storage record that is accessed with key.

Parameter
Type
Description

key

string

Max length 48

value

string

Max length 255

Space.Persistence.SetValue("MyValue", "Hello World");

UpdateRegionInfo

void UpdateRegionInfo (Action onComplete) void UpdateRegionInfo (Closure onComplete)

Parameter
Type
Description

Space.Persistence.SetRegionValue("TestRegionValue","456")

Space.Persistence.UpdateRegionInfo(function ()
    local value = Space.Persistence.RetrieveRegionValue("TestRegionValue")
    Space.Log(value)
end)
--print "456" to console.

RetrieveRegionValue

string RetrieveRegionValue (string key)

Parameter
Type
Description

Space.Persistence.RetrieveRegionValue("TestRegionValue");

SetRegionValue

void SetRegionValue (string key, string value)

Save the "value" to "key" on both your local cache and on the server.

Parameter
Type
Description

key

string

Max length 48

value

string

Max length 255

Space.Persistence.SetRegionValue("TestRegionValue","456");
PreviousSHostNextSPhysics

Last updated 1 year ago

Was this helpful?

void (Closure onComplete)

string (string key)

void (string key, string value)

void (Action onComplete) void (Closure onComplete)

string (string key)

void (string key, string value)

Updates your local cache with the most up-to-date values from the server. This function should be called before using the function.

Retrieves the saved value from "key" from your local cache. The function should be called first to update your local cache with the most up-to-date values from the server.

RetrieveRegionValue
UpdateRegionInfo
UpdateInfo
RetrieveValue
SetValue
UpdateRegionInfo
UpdateRegionInfo
RetrieveRegionValue
SetRegionValue