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: Script Does Nothing? (HELP!)

Previous Thread :: Next Thread 
DrCylonide is not online. DrCylonide
Joined: 21 Jul 2013
Total Posts: 1097
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 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
21 Feb 2015 09:32 AM
Youll need to add a loop
Report Abuse
DrCylonide is not online. DrCylonide
Joined: 21 Jul 2013
Total Posts: 1097
21 Feb 2015 09:32 AM
^ Where?
Report Abuse
DrCylonide is not online. DrCylonide
Joined: 21 Jul 2013
Total Posts: 1097
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 is not online. 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
DrCylonide is not online. DrCylonide
Joined: 21 Jul 2013
Total Posts: 1097
21 Feb 2015 09:57 AM
^ Nothing happened again. So confused
Report Abuse
parkiet3 is not online. parkiet3
Joined: 16 Jul 2011
Total Posts: 832
21 Feb 2015 11:51 AM
Try breakpoints
Report Abuse
protectiveEBob is not online. protectiveEBob
Joined: 09 Jul 2012
Total Posts: 1297
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
coolstorm543 is not online. coolstorm543
Joined: 26 Aug 2013
Total Posts: 1523
21 Feb 2015 12:23 PM
its not working probably from the maintenance
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