SaveNumber (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>SoulStealer9875
No edit summary
>SoulStealer9875
No edit summary
Line 8: Line 8:


{{clear floats}}
{{clear floats}}
<pre>
game.Players.PlayerAdded:connect(function(newPlayer)
newPlayer:WaitForDataReady()
newPlayer:SaveNumber("Number", game.Workspace.Number.Value)
end)
</pre>


[[Category:Methods]]
[[Category:Methods]]
{{Example|In one server...<pre>
game.Players.Telamon:SaveNumber("testNumber", 24 )
</pre>
In another server or the same server...<pre>
print( game.Players.Telamon:LoadNumber("testNumber") ) --> 24</pre>}}

Revision as of 15:43, 9 July 2011

SaveNumber( String key, Number value )
Returns nil
Description: Saves a number value that can be reloaded from any server via LoadNumber. The DataCost taken up by a saved number can be removed by saving 0 as the value.
In Object: Player


game.Players.PlayerAdded:connect(function(newPlayer)
	newPlayer:WaitForDataReady()
	newPlayer:SaveNumber("Number", game.Workspace.Number.Value)
end)