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: How do i do this with data persistance?

Previous Thread :: Next Thread 
Skuldak is not online. Skuldak
Joined: 19 Jan 2012
Total Posts: 55
29 Aug 2012 09:46 AM
How do I use data persistance to save a team? THanks for any help!
Report Abuse
thedestroyer115 is not online. thedestroyer115
Joined: 19 Dec 2010
Total Posts: 11546
29 Aug 2012 10:14 AM
You cannot save the team to a server but you CAN save it to a player. So you want to save which team the players on? Just save one boolvalue for each team. Then name the values after the teams. Then check which team the player is on, andthen (too many thens. xD) save the one value that has the same name as the players team as true.

Kind of complicated when you put it down in a paragraph, but it really isn't.

-------------------------
~thedestroyer115, some of the most kind and helpful posts possible!~
Report Abuse
pugzy is not online. pugzy
Joined: 16 Aug 2007
Total Posts: 11957
29 Aug 2012 10:25 AM
I would have had a variable that could equal one of the teams, and compared it that way.
Report Abuse
technoguyx is not online. technoguyx
Joined: 05 Dec 2008
Total Posts: 8286
29 Aug 2012 10:33 AM
Something like this

game.Players.PlayerAdded:connect(function(player)
player:WaitForDataReady() --the usual

if player:LoadString("Team") then --check if we've already saved his team
player.TeamColor = BrickColor.new( player:LoadString("Team") ) --if so, load
--you might want to reset him too
else
--I'm assuming you already assigned him a random team here
player:SaveString("Team", player.TeamColor)
end

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