SaveBoolean (Method): Difference between revisions
From Legacy Roblox Wiki
Jump to navigationJump to search
m Text replacement - "<code lua>" to "<SyntaxHighlight code="lua">" |
m Text replacement - "</SyntaxHighlight>" to "</syntaxhighlight>" |
||
(2 intermediate revisions by the same user not shown) | |||
Line 11: | Line 11: | ||
This example will save true as the value of the key 'HasPlayed' everytime a player leaves. | This example will save true as the value of the key 'HasPlayed' everytime a player leaves. | ||
< | <syntaxhighlight lang="lua"> | ||
game.Players.PlayerRemoving:connect(function(player) | game.Players.PlayerRemoving:connect(function(player) | ||
if player.DataReady then -- To make sure the data is ready. | if player.DataReady then -- To make sure the data is ready. | ||
Line 17: | Line 17: | ||
end | end | ||
end) | end) | ||
</ | </syntaxhighlight>}} | ||
==See Also== | ==See Also== |
Latest revision as of 04:59, 27 April 2023
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)