API:Class/Plugin/GetSetting

GetSetting

PluginSecurity: This member cannot be used in scripts, but is usable in the command bar and plugins.
Function of Plugin.pngPlugin
Variant GetSetting (
    string key
)
Parameters:
  1. key

Returns: Variant
Description: Retrieves a previously stored value with the given key, or nil if the given key doesn't exist.

Notes

This item is protected. Attempting to use it in a Script or LocalScript will cause an error.

Example

The below example would print the value saved to the key FirstTime. If the key doesn't exist, it would print nil.

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