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 » Scripting Helpers
Home Search
 

Re: Roblox Dbounce/Numplayers error [ Please Help :( ]

Previous Thread :: Next Thread 
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 06:18 PM
It pretty much doesnt go after if db == true and game.Players.NumPlayers >2 then :(
----------------------------------------------------------------------------------------------------------

tex = ""

function TextChange()
for i,v in pairs(game.Players:GetChildren())do
v.PlayerGui.ScreenGui.GuiBanner.Text = tex --Change Text
end
end

function tele()
for i,v in pairs(game.Players:GetChildren())do
v.Character.Torso.CFrame = CFrame.new(-80, 17.4, -123)--Teleports everyone to map
end
end



db = true
if db == true and game.Players.NumPlayers >= 2 then --Debounce and plyrs equal to or bigger than 2
db = false
tex = "The game will start in: 3"--Gui msg
TextChange()
wait(1)
tex = "The game will start in: 2"
TextChange()
wait(1)
tex = "The game will start in: 1"
TextChange()
wait(1)
tex = "Run!"
TextChange()
tele()
wait(3)
tex = ""
TextChange()
db = true
end
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
10 Sep 2013 06:21 PM
NumPlayers = game.Players:GetChildren()
if db == true and #NumPlayers >= 2
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 06:33 PM
Still doesnt work, but all I know is that it doesnt make it past the first if statement
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 06:34 PM
But thanks for helping! =D
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
10 Sep 2013 06:37 PM
If you are alone then it isn't going to continue. Since it doesn't repeat, when the server starts, one person is in it, the script does nothing about it and the program is done.
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 06:44 PM
No, I start a server(f7) and then I add players (alt+f7)
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
10 Sep 2013 06:47 PM
NumPlayers = game.Players:GetPlayers()
while db == true and #NumPlayers >= 2 do -- This is somewhat what he means.
db = false
tex = "The game will start in: 3"--Gui msg
TextChange()
wait(1)
tex = "The game will start in: 2"
TextChange()
wait(1)
tex = "The game will start in: 1"
TextChange()
wait(1)
tex = "Run!"
TextChange()
tele()
wait(3)
tex = ""
TextChange()
db = true
break
end
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 06:59 PM
Still Doenst work D=
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Sep 2013 06:59 PM
Why don't you just:

repeat wait(0) until Game.Players.NumPlayers >= 2
--code
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:00 PM
The reason I put a debounce is so it doesnt start again when it already did. This is what I have:

tex = ""
db = true

function TextChange()
for i,v in pairs(game.Players:GetChildren())do
v.PlayerGui.ScreenGui.GuiBanner.Text = tex --Change Text
end
end

function tele()
for i,v in pairs(game.Players:GetChildren())do
v.Character.Torso.CFrame = CFrame.new(-80, 17.4, -123)--Teleports everyone to map
end
end




NumPlayers = game.Players:GetPlayers()
while db == true and #NumPlayers >= 2 do -- This is somewhat what he means.
db = false
tex = "The game will start in: 3"--Gui msg
TextChange()
wait(1)
tex = "The game will start in: 2"
TextChange()
wait(1)
tex = "The game will start in: 1"
TextChange()
wait(1)
tex = "Run!"
TextChange()
tele()
wait(3)
tex = ""
TextChange()
db = true
break
end
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:02 PM
Bump
Report Abuse
1waffle1 is not online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
10 Sep 2013 07:06 PM
you told the loop to break on the first cycle.
this is the second time I've seen someone do this within the past day.
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:07 PM
So I get rid of the break?
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:09 PM
I tried breaking it, still doesnt work. I just know the problem is somwhere from the top to the first if statement
Report Abuse
godphantom555 is not online. godphantom555
Joined: 12 Mar 2011
Total Posts: 360
10 Sep 2013 07:10 PM
for i = 3,1,-1 do
    TextChange('The game will start in: '..i)
    wait(1)
end
wait(3)
TextChange('')
Report Abuse
godphantom555 is not online. godphantom555
Joined: 12 Mar 2011
Total Posts: 360
10 Sep 2013 07:11 PM
Changed TextChange() to TextChange(tex)
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:14 PM
Still doesnt work D= error is somwhere from top to first if statement. The print thing told me that
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:15 PM
Wait...I accidentally remove print...lemme try
Report Abuse
godphantom555 is not online. godphantom555
Joined: 12 Mar 2011
Total Posts: 360
10 Sep 2013 07:16 PM
By the way, The Players service has NumPlayers as a property. You don't need #game.Players:GetPlayers() to do it.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Sep 2013 07:16 PM
Stop using free model scripts and learn yourself
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:17 PM
? Its not a free model. There was a print originally, then another guy gave me a script, then I replaced my script with that, and the print got removed. Oh, and is it because there are comments? I put them in.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Sep 2013 07:18 PM
You shouldn't be trying to edit this if you don't know that print has no affect.
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:18 PM
But I can right?
Report Abuse
redlo43 is not online. redlo43
Joined: 16 Feb 2011
Total Posts: 4722
10 Sep 2013 07:19 PM
You don't really need prints for leaderboards...
Unless you really need organization
Report Abuse
russellthesnake is not online. russellthesnake
Joined: 24 May 2011
Total Posts: 410
10 Sep 2013 07:19 PM
Yes it does, there is a gui model roblox made so you can see print...oh and f7 alt+7 and alt+f7

The window f7 opens up is a server, and there is an output.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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