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: Game script... Need help.

Previous Thread :: Next Thread 
GUESTHAXX is not online. 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 is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
06 Dec 2012 11:30 PM
Bump
Report Abuse
cody20175 is not online. cody20175
Joined: 23 Jul 2010
Total Posts: 6958
06 Dec 2012 11:33 PM
[ Content Deleted ]
Report Abuse
GUESTHAXX is not online. 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
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
06 Dec 2012 11:43 PM
if count == 1 then -- error here, but I don't see the error?

~ thedeathmaster01 ~
Report Abuse
cody20175 is not online. cody20175
Joined: 23 Jul 2010
Total Posts: 6958
06 Dec 2012 11:43 PM
[ Content Deleted ]
Report Abuse
michael1784 is not online. michael1784
Joined: 15 Feb 2011
Total Posts: 3322
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 is not online. 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 is not online. GUESTHAXX
Joined: 16 Apr 2012
Total Posts: 3370
07 Dec 2012 07:57 PM
Bump
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