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: Zombie Maker Script

Previous Thread :: Next Thread 
Skenderbeu98 is not online. Skenderbeu98
Joined: 11 Aug 2013
Total Posts: 467
26 Feb 2014 02:43 PM
So basically I am trying to get all the players, and make one of them a zombie (Bright Green team)
Output say's something about a bad interval or something with math.random...

for i,v in pairs(game.Players:GetPlayers()) do
wait(4)
x = game.Players:GetPlayers()
zombie = math.random(1,#x)
if v.TeamColor == "Mid gray" then
zombie.TeamColor = BrickColor.new("Bright green")
end
end
Report Abuse
ayub32 is not online. ayub32
Joined: 27 Dec 2009
Total Posts: 485
26 Feb 2014 02:44 PM
for i,v in pairs(game.Players:GetPlayers()) do
wait(4)
zombie = math.random(1,#v)
if v.TeamColor == "Mid gray" then
zombie.TeamColor = BrickColor.new("Bright green")
end
end
Report Abuse
Skenderbeu98 is not online. Skenderbeu98
Joined: 11 Aug 2013
Total Posts: 467
26 Feb 2014 02:54 PM
Nope...
This is so annoying idk why this won't work.
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
26 Feb 2014 02:55 PM
if v == zombie then?
idk
Report Abuse
Skenderbeu98 is not online. Skenderbeu98
Joined: 11 Aug 2013
Total Posts: 467
26 Feb 2014 03:12 PM
Someone help D:
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
26 Feb 2014 03:31 PM
"Players:GetPlayers"
Is that legit? Just use GetChildren
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
26 Feb 2014 03:34 PM
wait(4)
x = game.Players:GetChildren())
zombie = math.random(1,#x)

a = Instance.new("IntValue",zombie)
a.Name = "zombie"

for b,v in pairs(x) do
if v:findFirstChild("zombie") then
v.TeamColor = BrickColor.new("Bright green")
end
end

--untested
Report Abuse
Skenderbeu98 is not online. Skenderbeu98
Joined: 11 Aug 2013
Total Posts: 467
26 Feb 2014 03:37 PM
@maxo
Yea it's legit, and I tried :GetChildren() too
Report Abuse
DevDerp is not online. DevDerp
Joined: 25 Jan 2009
Total Posts: 1000
26 Feb 2014 03:46 PM

function ChooseZombiePlayer()
x = game.Players:GetChildren()
zombie = math.random(1,#x)
for i,v in pairs(x) do
wait(4)

if i==zombie and v.TeamColor == "Mid gray" then
zombie.TeamColor = BrickColor.new("Bright green")
end
end

end
Report Abuse
DevDerp is not online. DevDerp
Joined: 25 Jan 2009
Total Posts: 1000
26 Feb 2014 04:17 PM
function ChooseZombiePlayer()
x = game.Players:GetChildren()
zombie = math.random(1,game.Players.NumPlayers)
for i,v in pairs(x) do
wait(4)

if i==zombie and v.TeamColor == "Mid gray" then
zombie.TeamColor = BrickColor.new("Bright green")
end
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