brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 24 Dec 2011 03:44 PM |
while true do wait() local people = game.Players:GetChildren() for i = 1,#people do if game.Workspace.GamePlay.BombPlanted.Value == false then if people[i].Character.Torso.BrickColor == BrickColor.new(game.Workspace.GamePlay.GameMode.Team.Value) then if (people[i].Character.Torso.Position - script.Parent.Main.Position).magnitude <= 8 then if people[i].PlayerGui:FindFirstChild("BombPlantGui") == nil then game.Lighting:FindFirstChild("BombPlantGui"):Clone().Parent = people[i].PlayerGui end end end end end |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Dec 2011 03:46 PM |
| Try using a generic for instead of numeric. |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 24 Dec 2011 03:47 PM |
| I have no clue what that means LOL |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2011 03:47 PM |
while true do repeat wait() until game.NumPlayers <= 2 -- ummm... this what your looking for? wait() local people = game.Players:GetChildren() for i = 1,#people do if game.Workspace.GamePlay.BombPlanted.Value == false then if people[i].Character.Torso.BrickColor == BrickColor.new(game.Workspace.GamePlay.GameMode.Team.Value) then if (people[i].Character.Torso.Position - script.Parent.Main.Position).magnitude <= 8 then if people[i].PlayerGui:FindFirstChild("BombPlantGui") == nil then game.Lighting:FindFirstChild("BombPlantGui"):Clone().Parent = people[i].PlayerGui end end end end end
~I've been to nil and back. |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 24 Dec 2011 03:49 PM |
| Noo I mean the whole script stops when there is more then 1 player in the server |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Dec 2011 03:50 PM |
@MrGameNWatch
He wants it to work for all players, not just one.
@CreatorofThread
Numeric for
local people = game.Players:GetChildren()) for i = 1,#people do --code end
Generic
for i,v in pairs(game.Players:GetChildren()) do --Code using v end
|
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 24 Dec 2011 03:56 PM |
@miz656 It doesnt even work with 1 player now |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Dec 2011 03:56 PM |
| That's caused you used it wrong. |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 24 Dec 2011 04:01 PM |
while true do wait() for i,v in pairs(game.Players:GetChildren()) do if game.Workspace.GamePlay.BombPlanted.Value == false then if people[i].Character:FindFirstChild("Torso") ~= nil then if people[i].Character.Torso.BrickColor == BrickColor.new(game.Workspace.GamePlay.GameMode.Team.Value) then if (people[i].Character.Torso.Position - script.Parent.Main.Position).magnitude <= 8 then if people[i].PlayerGui:FindFirstChild("BombPlantGui") == nil then game.Lighting:FindFirstChild("BombPlantGui"):Clone().Parent = people[i].PlayerGui end end end end if (people[i].Character.Torso.Position - script.Parent.Main.Position).magnitude >= 8 then if people[i].PlayerGui:FindFirstChild("BombPlantGui") ~= nil then people[i].PlayerGui:FindFirstChild("BombPlantGui"):Remove() end end end end end
|
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Dec 2011 04:02 PM |
| Since you removed the numeric for Change people[i] to v. |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 24 Dec 2011 04:05 PM |
while true do wait() local people = game.Players:GetChildren() for i,v in pairs(game.Players:GetChildren()) do if game.Workspace.GamePlay.BombPlanted.Value == false then if people[i].Character:FindFirstChild("Torso") ~= nil then if people[i].Character.Torso.BrickColor == BrickColor.new(game.Workspace.GamePlay.GameMode.Team.Value) then if (people[i].Character.Torso.Position - script.Parent.Main.Position).magnitude <= 8 then if people[i].PlayerGui:FindFirstChild("BombPlantGui") == nil then game.Lighting:FindFirstChild("BombPlantGui"):Clone().Parent = people[i].PlayerGui end end end end if (people[i].Character.Torso.Position - script.Parent.Main.Position).magnitude >= 8 then if people[i].PlayerGui:FindFirstChild("BombPlantGui") ~= nil then people[i].PlayerGui:FindFirstChild("BombPlantGui"):Remove() end end end end end end
|
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Dec 2011 04:06 PM |
Lol, bro! You can't have a numeric and generic loop.
Choose! |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
|
| 24 Dec 2011 04:07 PM |
| ... Just do it for me please |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Dec 2011 04:10 PM |
Can't do it now because my family is here and I have to log off soon.
Later if it's still not fixed. |
|
|
| Report Abuse |
|
|
brayden99
|
  |
| Joined: 30 Sep 2007 |
| Total Posts: 1243 |
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 24 Dec 2011 04:13 PM |
| Maybe tonight...At 12. I'ma video santa and get my camera so see if he's real :) |
|
|
| Report Abuse |
|
|