generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Data persistence

Previous Thread :: Next Thread 
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
03 Jan 2013 04:43 PM
game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
Model = p.PlayerGui:FindFirstChild("Lok")
if Model then
p:SaveInstance(Model)
end
end)
------------------------------

Now this is in a script in the workspace, if the player leaves it should save the IntValue called "Lok" if the lok is in the player it will prevent a gui from spawning, this is good but I need to know if this will work, if it does then how will I load the "Lok" thing , not it's value but the IntValue it's self.
Report Abuse
YellowBrick1 is not online. YellowBrick1
Joined: 06 May 2009
Total Posts: 865
03 Jan 2013 04:49 PM
You forgot to indicate what variable the model will be saved to.
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
03 Jan 2013 04:56 PM
game.Players.PlayerRemoving:connect(function(p)
p:WaitForDataReady()
repeat
wait()
Model = p.PlayerGui:FindFirstChild("Lok")
until Model ~= nil
if Model then
p:SaveInstance("Lock",Model)
end
end)
-----------------------------------

This waits until the player fills out the gui and then get's the IntValue named "Lok"

then this loads it but it wont work-


game.Players.PlayerAdded:connect(function(p)
p:WaitForDataReady()
Parts = p:LoadInstance("Lock")
wait()
Parts.Parent = p
end)
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
03 Jan 2013 05:07 PM
bump
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
03 Jan 2013 05:19 PM
Just do player:LoadInstance("Lock") and remove the rest.
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
03 Jan 2013 05:22 PM
Still wont work..
Report Abuse
ninja5566 is not online. ninja5566
Joined: 14 Jan 2009
Total Posts: 5233
03 Jan 2013 06:45 PM
y is this so hard
Report Abuse
crouton04 is not online. crouton04
Joined: 07 Jul 2010
Total Posts: 4459
03 Jan 2013 06:56 PM
game.Players.PlayerAdded:connect(function (p)
p:WaitForDataReady()
wait()
p:LoadBoolean("Lock")
end)

game.Players.PlayerRemoving:connect(function (plr)
plr:WaitForDataReady()
wait()
p:SaveBoolean("Lock",Lock.Value) -- guessing it's a boolean..
end)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image