PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

SetSetting

Stores a given value for later use under the given key. The value will persist even after studio is closed.

Parameters

Name Type Default Description

key

Returns

Return Type Summary

Code Samples


Plugin:SetSetting1

The below example would save the value of the key “FirstTime” as false. This could be useful in plugins which provide the user with a tutorial of it’s use.

 
local Plugin = PluginManager():CreatePlugin()
local RanBefore = Plugin:GetSetting("RanBefore")
Plugin:SetSetting("RanBefore", true)

if RanBefore then
	print("Welcome back!")
else
	print("Welcome! Thanks for installing this plugin!")
end