|
| 21 Feb 2015 09:30 AM |
Here is the complete script. When I launch the game, function moreplayers does not run, even though there are less than two players. What is wrong?
--beginning of round
if game.Players.NumPlayers >= 2 then playgame() else moreplayers() end
function playgame() print("playgame") game.StarterGui.ScreenGui.moreplayers.Visible=false local beginning = game.StarterGui.ScreenGui.beginning beginning.Visible=true wait(5) beginning.Visible=false
local modelOfBricks = game.Workspace.spawnwalls --The model with all the bricks in it. local nameOfBricks = "spawnwall" --The name of the blocks that should be changed (keep quotations).
for i,v in pairs(modelOfBricks:GetChildren()) do if v.Name == nameOfBricks then v.Transparency = 1 v.CanCollide=false end end
local go = game.StarterGui.ScreenGui.go go.Visible=true wait(4) go.Visible=false
wait(10) --END OF ROUND
local roundend = game.StarterGui.ScreenGui.roundend roundend.Visible=true wait(4) roundend.Visible=false
for i, player in ipairs(game.Players:GetPlayers()) do if player.Character then local hum = player.Character:FindFirstChild('Humanoid') if hum then hum.Health = 0 end end end
modelOfBricks = game.Workspace.spawnwalls --The model with all the bricks in it. nameOfBricks = "spawnwall" --The name of the blocks that should be changed (keep quotations).
for i,v in pairs(modelOfBricks:GetChildren()) do if v.Name == nameOfBricks then v.Transparency = 0 v.CanCollide=true end end
end
function moreplayers() print("moreplayers") game.StarterGui.ScreenGui.moreplayers.Visible=true end |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
| |
|
| |
|
|
| 21 Feb 2015 09:34 AM |
| ^^ I added repeat at the beginning and until 1+1==3 at the bottom.. is that it? (Please note I am a beginner scripter. |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 21 Feb 2015 09:48 AM |
repeat wait() moreplayers() until #game.Players:GetChildren() >= 2 playgame() |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2015 09:57 AM |
| ^ Nothing happened again. So confused |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
| |
|
|
| 21 Feb 2015 12:20 PM |
Move this to the end.
while true do if game.Players.NumPlayers >= 2 then playgame() else moreplayers() end wait(5) end |
|
|
| Report Abuse |
|
|
|
| 21 Feb 2015 12:23 PM |
| its not working probably from the maintenance |
|
|
| Report Abuse |
|
|