of     1   

OneWhoCreates
#64322474Wednesday, March 14, 2012 7:21 PM GMT

there is no error in output when i run it in solo mode. function onPlayerRespawned(newPlayer) while true do if newPlayer.TeamColor == game.Teams.Prisoner.TeamColor then if newPlayer.leaderstats.D.Value >= 0 then newPlayer.TeamColor = BrickColor.new("Lime green") newPlayer.leaderstats.D.Value = 0 newPlayer.Character.Humanoid.Health = 0 end end end end
1billybob1
#64325869Wednesday, March 14, 2012 8:19 PM GMT

Don't keep the ends on one line. Try spacing them : function onPlayerRespawned(newPlayer) while true do if newPlayer.TeamColor == game.Teams.Prisoner.TeamColor then if newPlayer.leaderstats.D.Value >= 0 then newPlayer.TeamColor = BrickColor.new("Lime green") newPlayer.leaderstats.D.Value = 0 newPlayer.Character.Humanoid.Health = 0 end end end end --If that doesn't work, try removing an end.
Bannana97
#64326605Wednesday, March 14, 2012 8:30 PM GMT

You never connected the function to the character.
OneWhoCreates
#64326947Wednesday, March 14, 2012 8:36 PM GMT

When the player respawns the script should be checking to see if they are on the Prisoner team. Once that is determined and if the player is on the prisoner team the script should be doing a loop to determine when a prisoners Days reaches 0. Once a prisoners Days raches 0 the script should change them to the Civilians team, reset there days to 0, and kill the player(so they can go to the correct location and get the civilian on respawn items. hope this clarifies what im trying to do a little better..
Bannana97
#64327151Wednesday, March 14, 2012 8:39 PM GMT

Simply connect that function to the player's respawn event, and then you're good to go.
RobloxNewb01
#64327375Wednesday, March 14, 2012 8:42 PM GMT

Ahem, connection line pl0x?
OneWhoCreates
#64335719Wednesday, March 14, 2012 10:48 PM GMT

The script is somewhat working now. The issue im having now is it is not waiting on the days to reach 0 before changing the team. and once it changes team it continues to respawn the player even though they are on the new team. here is the updated script: function onPlayerRespawned(newPlayer) if newPlayer.TeamColor == game.Teams.Prisoner.TeamColor then while true do wait(5) if newPlayer.leaderstats.D.Value >= 0 then script.TimeServedGUI:Clone().Parent = newPlayer.PlayerGui newPlayer.TeamColor = game.Teams.Civilian.TeamColor newPlayer.leaderstats.D.Value = 0 wait(1) newPlayer.Character.Torso.CFrame = CFrame.new(Vector3.new(-45.15, 209, 252.6)) wait(3) newPlayer.Character.Humanoid.Health = 0 end end end end function onPlayerAdded(newPlayer) newPlayer.Changed:connect(function(property) if property == "Character" then onPlayerRespawned(newPlayer) end end) end game.Players.PlayerAdded:connect(onPlayerAdded)
OneWhoCreates
#64339657Wednesday, March 14, 2012 11:50 PM GMT

anyone ?
OneWhoCreates
#64362217Thursday, March 15, 2012 10:51 AM GMT

bump
Cheater
#64362626Thursday, March 15, 2012 11:35 AM GMT

That's because you use while true do. Use return.
OneWhoCreates
#64363252Thursday, March 15, 2012 12:25 PM GMT

could you be a little more clear please? I tried replacing while true do end with return untill false but nothing worked...
OneWhoCreates
#64373906Thursday, March 15, 2012 8:09 PM GMT

bump...
OneWhoCreates
#64382099Thursday, March 15, 2012 10:07 PM GMT

come on guys I know someone has to know how to do this correctly... I have been working in this a while and just cant seem to figure out the reason its not working correctly.
OneWhoCreates
#64385228Thursday, March 15, 2012 10:53 PM GMT

stupid typos ... problem solved.

    of     1