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: Is there a way to check if ALL was removed?

Previous Thread :: Next Thread 
Rackm is not online. Rackm
Joined: 07 Jan 2014
Total Posts: 718
24 Jul 2014 06:41 PM
Like if there is a whole model of StringValues and is there a way to check if ALL was removed?


Here is what i have that makes them get removed:
repeat
for i,v in pairs (game.Workspace.ArePlaying:GetChildren()) do
game.Players.PlayerRemoving:connect(function(player)
if player.Name == v.Name then
v:Remove()
end
end)
for t,k in pairs (game.Players:GetChildren()) do
k.Character.Humanoid.Died:connect(function(died)
if k.Name == v.Name then
v:Remove()
end
end)
end
end
until game.Workspace.GameEnded.Value == true
Report Abuse
Undoomed is not online. Undoomed
Joined: 19 Oct 2010
Total Posts: 1662
24 Jul 2014 06:43 PM
Look for one and if it's nil, then..
Report Abuse
Rackm is not online. Rackm
Joined: 07 Jan 2014
Total Posts: 718
24 Jul 2014 06:45 PM
So it will be like:

if v == nil then
--stuff
end
Report Abuse
Rackm is not online. Rackm
Joined: 07 Jan 2014
Total Posts: 718
24 Jul 2014 07:05 PM
So this script with the if v == nil then

repeat
    for i,v in pairs (game.Workspace.ArePlaying:GetChildren()) do
        game.Players.PlayerRemoving:connect(function(player)
            if player.Name == v.Name then
                v:Remove()
            end
        end)
        for t,k in pairs (game.Players:GetChildren()) do
            k.Character.Humanoid.Died:connect(function(died)
                if k.Name == v.Name then
                    v:Remove()
                end
            end)
        end
        if v == nil then
            game.Workspace.GameEnded.Value = true
        end
    end
until game.Workspace.GameEnded.Value == true
Report Abuse
Undoomed is not online. Undoomed
Joined: 19 Oct 2010
Total Posts: 1662
24 Jul 2014 07:06 PM
I'm not going to open up Roblox Studio and test it.. Does it work or not?
Report Abuse
Luc599345 is not online. Luc599345
Joined: 25 Jul 2008
Total Posts: 1169
24 Jul 2014 07:08 PM
If you're asking if it's possible to see if a model is empty, you can do

if #model:GetChildren() == 0 then
[...]
end
Report Abuse
Undoomed is not online. Undoomed
Joined: 19 Oct 2010
Total Posts: 1662
24 Jul 2014 07:09 PM
@Luc, he wants to remove players who join the game. He wants to check when there are no more people that meet the requirements to delete, then have an event happen such as print("Hurray everyone is banned!")
Report Abuse
Rackm is not online. Rackm
Joined: 07 Jan 2014
Total Posts: 718
24 Jul 2014 07:10 PM
It works. Thanks.
Report Abuse
Luc599345 is not online. Luc599345
Joined: 25 Jul 2008
Total Posts: 1169
24 Jul 2014 07:11 PM
No problem.
Report Abuse
Rackm is not online. Rackm
Joined: 07 Jan 2014
Total Posts: 718
24 Jul 2014 07:13 PM
@un

No, i am trying to check if they leaved the game or reset it will remove their value which their name is added into a model at the beginning of the script.
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