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: someone help please [numplayers]

Previous Thread :: Next Thread 
DrizziPop is not online. DrizziPop
Joined: 01 Oct 2014
Total Posts: 1914
02 Apr 2016 01:27 PM
ok so im bad at explaining but ill try to say it

pretend i used this

while true do
if game.players.numplayers > 1 then
a = instance.new("hint")
a.parent = game.workspace
a.Text = "idk"
elseif game.players.numplayers <= 1 then
print("2 or more players r needed idk y im printing this in console lol")
end

how do i make it so everything in game.players.numplayers > 1 gets removed when the player count goes back to one (if a person leaves)

Report Abuse
DrizziPop is not online. DrizziPop
Joined: 01 Oct 2014
Total Posts: 1914
02 Apr 2016 01:29 PM
8
Report Abuse
DrizziPop is not online. DrizziPop
Joined: 01 Oct 2014
Total Posts: 1914
02 Apr 2016 01:30 PM
,
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
02 Apr 2016 01:30 PM
why did you bump this barely a minute after posting
Report Abuse
DrizziPop is not online. DrizziPop
Joined: 01 Oct 2014
Total Posts: 1914
02 Apr 2016 01:31 PM
idk i just rly need help
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
02 Apr 2016 01:31 PM
Maybe this?
local NumPlayers = game.Players.NumPlayers
NumPlayers.Changed:connect(function()
if NumPlayers > 1 then
a = Instance.new("Hint")
a.Name = "TheHint"
a.Parent = game.Workspace
a.Text = "idk"

elseif NumPlayers <= 1 then

a = game.Workspace:FindFirstChild("TheHint")
if a ~= nil then
a:Destroy()
end
end
end)
Report Abuse
DrizziPop is not online. DrizziPop
Joined: 01 Oct 2014
Total Posts: 1914
02 Apr 2016 01:32 PM
ya but what if i have like a bunch of things running like guis, part clones and stuff
Report Abuse
badguy1233 is not online. badguy1233
Joined: 23 Jul 2009
Total Posts: 885
02 Apr 2016 01:33 PM
"how do i make it so everything in game.players.numplayers > 1"

game.players.numplayers > 1 is not an instance.
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
02 Apr 2016 01:34 PM
@Drizzi What do you mean? Elaborate further.
Report Abuse
DrizziPop is not online. DrizziPop
Joined: 01 Oct 2014
Total Posts: 1914
02 Apr 2016 01:37 PM
like im working on a minigames game and its going to like have things such as a time left gui, cloning the minigame map, etc. i want to make it so if there is only 1 player left, all the items that got cloned back when there was more than 1 player gets deleted
Report Abuse
ExtremeBuilder15 is not online. ExtremeBuilder15
Joined: 01 May 2012
Total Posts: 3176
02 Apr 2016 01:43 PM
Just add a check at the start of all the function that checks how many players are in the game, and if there is the required amount, continue on with the script.
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