Aidy6666
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 2930 |
|
|
| 21 Nov 2011 07:36 PM |
_G.Red and _G.Blue have already been defined
The problem is, is that after awhile, each of these points with this code in it, after awhile, I don't know why, just stops working. Anyone know why that might happen??
control = 0 distance = 10 while true do if control > 0 then script.Parent.BrickColor = BrickColor.new("Really red") _G.Red = _G.Red + 1 elseif control < 0 then script.Parent.BrickColor = BrickColor.new("Really blue") _G.Blue = _G.Blue + 1 else script.Parent.BrickColor = BrickColor.new("Light stone grey") end wait(1) for a, b in pairs(game.Workspace:GetChildren()) do if b.className == "Model" then if game.Players:findFirstChild(b.Name) then if game.Players[b.Name].TeamColor == BrickColor.new("Bright red") then if control < 10 and (script.Parent.Position - b.Torso.Position).magnitude < distance then control = control + 1 end elseif game.Players[b.Name].TeamColor == BrickColor.new("Bright blue") then if control > -10 and (script.Parent.Position - b.Torso.Position).magnitude < distance then control = control - 1 end end end end end end |
|
|
| Report Abuse |
|
|
RackORibs
|
  |
| Joined: 25 Apr 2011 |
| Total Posts: 22 |
|
|
| 21 Nov 2011 07:42 PM |
| Have you gotten an error on the output? |
|
|
| Report Abuse |
|
|
|
| 21 Nov 2011 07:43 PM |
| _G or Shared isen't the best way to hold a number value, I'd hold it in a Instance.new("NumberValue") |
|
|
| Report Abuse |
|
|
|
| 21 Nov 2011 08:02 PM |
@Robo
It does not matter. :l
@Thread Poster
Output? |
|
|
| Report Abuse |
|
|
Aidy6666
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 2930 |
|
|
| 21 Nov 2011 08:24 PM |
It works in singleplayer perfectly, have to do it in multiplayer, a bunch of them broke, except 1, (I have 8 of them), and we seem to be unable to break this last one, so does this code look like if there's more than 1 of these it would break anything? In singleplayer it worked fine though
|
|
|
| Report Abuse |
|
|
| |
|
Aidy6666
|
  |
| Joined: 17 Sep 2007 |
| Total Posts: 2930 |
|
|
| 21 Nov 2011 08:31 PM |
| works in singleplayer, not in multiplayer, so can't see output |
|
|
| Report Abuse |
|
|