LoadInstance (Method): Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>SoulStealer9875
No edit summary
>MrNicNac
Needs :WaitForDataReady()
Line 11: Line 11:
<pre>
<pre>
game.Players.PlayerAdded:connect(function(newPlayer)
game.Players.PlayerAdded:connect(function(newPlayer)
newPlayer:WaitForDataReady() -- Wait for the player's data cache to load
p = newPlayer:LoadInstance("Model")
p = newPlayer:LoadInstance("Model")
p.Parent = game.Workspace
p.Parent = game.Workspace

Revision as of 15:42, 9 July 2011

LoadInstance( String key )
Returns Instance value
Description: Loads an instance value that was previously saved to the player via SaveInstance.
In Object: Player


game.Players.PlayerAdded:connect(function(newPlayer)
	newPlayer:WaitForDataReady() -- Wait for the player's data cache to load
	p = newPlayer:LoadInstance("Model")
	p.Parent = game.Workspace
end)