SaveBoolean (Method)

From Legacy Roblox Wiki
Revision as of 04:59, 27 April 2023 by Realjame (talk | contribs) (Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
SaveBoolean( string key, bool value )
Returns nil
Description: Saves a boolean value that can be reloaded from any server via LoadBoolean.
Member of: Player


Example

This example will save true as the value of the key 'HasPlayed' everytime a player leaves.

game.Players.PlayerRemoving:connect(function(player)
	if player.DataReady then -- To make sure the data is ready.
		player:SaveBoolean('HasPlayed', true) -- Save the boolean.
	end
end)


See Also