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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|