GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
|
| 06 Dec 2012 11:15 PM |
I want to create a script that will change your team name to "someothercolor" when you die... But all the players team color will change back to the original team name when the game restarts...
So here's my script... Needs alot of work...
----Variables-----
hum_team = game.Teams["Humans"] zom_team = game.Teams["Ghost People"] system = script.Parent --Aka game.Workspace is_playing = system.Playing --BoolValue playing = false interrupted = false minutes = 0 seconds = 0 ----FunctionKillPlayers----
function killPlayers() local player = game.Players:GetChildren() if(#player>0)then for p = 1, #player do if(player[p].Character~=nil)then local h = player[p].Character:FindFirstChild("Humanoid") if(h.Health>0)then player[p].Character.Humanoid.Health = 0 player[p].TeamColor = hum_team.TeamColor end end end
----Function DeadChange---
function DeadChange() local player = game.Players:GetChildren() if(#player>0)then for p = 1, #player do --P defines player right? if(player[p].Character~=nil)then local h = player[p].Character:FindFirstChild("Humanoid") if(h.Health<0)then if player[p]:FindFirstChild("Dead")~=nil then player[p].Dead.Value = false player[p].Class.Value = "Zombie" player[p].TeamColor = zom_team.TeamColor end end end end
----FunctionCountPlayers(I MIGHT need this.)
function countPlayers() local count = 0 local player = game.Players:GetChildren() if(#player>0)then for p = 1, #player do if(player[p].Character~=nil)then count = count +1 end end end return count end
----FunctionEndGame----
function EndGame() if count = 1 then interrupted = true then is_playing = false killPlayers() wait(1) is_playing = true else system.ObjectiveOne == true and system.ObjectiveTwo ==true then is_playing = false local h = player[p].Character:FindFirstChild("Humanoid") if(h.Health>0)then player[p].Character.Humanoid.Health = 0 player[p].TeamColor = hum_team.TeamColor wait(1) is_playing = true end end end end end
----FunctionCountDown----
function countDown() seconds = seconds -1 if(seconds<0)then minutes = minutes -1 seconds = 59 if(minutes<0)then playing = false return true end end
return false end
minutes = 60 seconds = 59
if playing = true then while(playing==true)and(countDown()==false)do
----Messages----
if(interrupted==true)then displayMsg("Need one more player to continue the game") else if(playing==false)then displayMsg("The Casino is finally opened... After the 200 year delay...") else displayMsg("You failed.") end end
I don't even have to test to know I will get stopped at line 1 by output... Yes I did make this, its horribly scripted. :l
|
|
|
| Report Abuse |
|
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|
cody20175
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 6958 |
|
| |
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
|
| 06 Dec 2012 11:38 PM |
Ok.
Workspace.GameTestMine:63: 'then' expected near '='
function EndGame() if count = 1 then -- error here, but I don't see the error?
|
|
|
| Report Abuse |
|
|
|
| 06 Dec 2012 11:43 PM |
if count == 1 then -- error here, but I don't see the error?
~ thedeathmaster01 ~ |
|
|
| Report Abuse |
|
|
cody20175
|
  |
| Joined: 23 Jul 2010 |
| Total Posts: 6958 |
|
| |
|
|
| 07 Dec 2012 12:15 AM |
First you have "Ghost People" then later in the script, you put "Zombies" Error. BTW, whats the Output? |
|
|
| Report Abuse |
|
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
|
| 07 Dec 2012 10:09 AM |
Output was posted above in my last post.
If your talking about this part " player[p].Class.Value = "Zombie" " I named it zombie so it wouldn't be hard to remember the other teams name, Ghost People are pretty much zombies just with a cooler name...
|
|
|
| Report Abuse |
|
|
GUESTHAXX
|
  |
| Joined: 16 Apr 2012 |
| Total Posts: 3370 |
|
| |
|