LoadBoolean (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 code="lua">" to "<syntaxhighlight lang="lua">"
 
(One intermediate revision by the same user not shown)
Line 13: Line 13:
This code would print the {{type|boolean}} value saved to the "Bool" key of every player that enters.
This code would print the {{type|boolean}} value saved to the "Bool" key of every player that enters.


<SyntaxHighlight code="lua">
<syntaxhighlight lang="lua">
game.Players.PlayerAdded:connect(function(player)
game.Players.PlayerAdded:connect(function(player)
player:WaitForDataReady()
player:WaitForDataReady()
print(player:LoadBoolean("Bool"))
print(player:LoadBoolean("Bool"))
end)
end)
</SyntaxHighlight>
</syntaxhighlight>


==See Also==
==See Also==

Latest revision as of 06:08, 27 April 2023

LoadBoolean( string key )
Returns bool
Description: Returns a boolean value that was previously saved to the player via SaveBoolean with the same key. Returns false if the key doesn't exist, not nil.
Member of: Player


Example

This code would print the boolean value saved to the "Bool" key of every player that enters.

game.Players.PlayerAdded:connect(function(player)
	player:WaitForDataReady()
	print(player:LoadBoolean("Bool"))
end)

See Also