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 » Scripters
Home Search
 

Re: practically the same code, but it won't work

Previous Thread :: Next Thread 
DeGames is online. DeGames
Joined: 08 Sep 2012
Total Posts: 1028
20 Jan 2017 09:34 PM
Everything works except it won't go through the if statement on the second part. It is commented with --[HERE]
The first part uses the same setup, but it works?





allteams = game.Teams:GetChildren()

teamnames.OnServerEvent:connect(function(player,team,blue)
print("www")
if blue then
print("d")
local foundteam = nil
for i,v in pairs(allteams)do
if v.TeamColor == BrickColor.new("Steel blue") then
print("wwerer")
foundteam = v
print(foundteam)
end
foundteam.Name = team
end

elseif blue == false then
local foundteam = nil
print("dggd")
for i,v in pairs(allteams)do
print("dddgfgd")
if v.TeamColor == BrickColor.new("Earth green") then
--[HERE]It doesn't get into here?? And the team color is 100% "Earth green"
print(foundteam)
foundteam = v

end
foundteam.Name = team
end

end
end)


Report Abuse
DeGames is online. DeGames
Joined: 08 Sep 2012
Total Posts: 1028
20 Jan 2017 09:52 PM
ahh i keep looking and looking it over, I just can't see a problem. anyone see whats wrong? maybe it'd be best if i look at it again some other time. idk


Report Abuse
scottmike0 is not online. scottmike0
Joined: 14 Sep 2008
Total Posts: 1073
20 Jan 2017 09:57 PM
print V.TeamColor before you go into the second If statement.
Report Abuse
DeGames is online. DeGames
Joined: 08 Sep 2012
Total Posts: 1028
21 Jan 2017 03:48 PM
ohh thanks i see the problem now, hm that's a good habit. I should print what im trying to find first lol


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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