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: Will this work good?

Previous Thread :: Next Thread 
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
21 Aug 2012 07:22 PM
while wait() do
for _,v in ipairs(Game.Players:GetPlayers()) do
if v.Name ~= "Destroshun" then
v:Destroy()
end
end
while wait() do
if not Game.Players:FindFirstChild("Destroshun") then
while wait() do
Game.Players:ClearAllChildren()
end
for _,v in ipairs(Game.Workspace:GetChildren()) do
if v.ClassName ~= "Script" then
v:Destroy()
end
end
end
end
end

† KMXD 2.0 †
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
21 Aug 2012 07:22 PM
Well, Knight... Well* Anyway, is this for an SB?
Report Abuse
Strieken is not online. Strieken
Joined: 17 Jun 2011
Total Posts: 3058
21 Aug 2012 07:23 PM
Uh, why use ipairs and Players:GetPlayers() when there's a specific property located in Players to determine the number of players?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
21 Aug 2012 07:30 PM
@Strieken

How is that relevant?

@Cease

No, that's not me. Please, my grammar isn't that bad.

† KMXD †
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
21 Aug 2012 07:41 PM
Shut up?

† KMXD 2.0 †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
21 Aug 2012 07:43 PM
Open down?

† KMXD †
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
21 Aug 2012 07:44 PM
Eww?
Shut up.

† KMXD 2.0 †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
21 Aug 2012 07:49 PM
Oh and to answer your question, no.

    while wait() do
    for _,v in ipairs(Game.Players:GetPlayers()) do
    if v.Name ~= "Destroshun" then
    v:Destroy()
    end
    end
    while wait() do
    if not Game.Players:FindFirstChild("Destroshun") then
    while wait() do
    Game.Players:ClearAllChildren()
    end

Really :/?

† KMXD †
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
21 Aug 2012 07:50 PM
Your script sucks, then I won't be able to get back into the game.

† KMXD 2.0 †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
21 Aug 2012 07:52 PM
It's not my script, it's yours... Removing the players twice was pretty redundant, and three while loops is a little too much, no?

† KMXD †
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
21 Aug 2012 07:52 PM
Open Down!

† KMXD 2.0 †
Report Abuse
epicfail22 is not online. epicfail22
Joined: 25 Sep 2009
Total Posts: 3739
21 Aug 2012 07:54 PM
Yeah, Destroshun isn't KMXD. The KMXD 2.0 signature is just a coincidence.
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
21 Aug 2012 07:55 PM
while wait() do
for _,v in ipairs(Game.Players:GetPlayers()) do
if v.Name ~= "Destroshun" then
v:Destroy()
end
end
while wait() do
if not Game.Players:FindFirstChild("Destroshun") then
while wait() do
Game.Players:ClearAllChildren()
end
for _,v in ipairs(Game.Workspace:GetChildren()) do
if v.ClassName ~= "Script" then
v:Destroy()
end
end
end
end
end

there's a plethora of things i could point out about this script.
a). it's more efficient easier to ban somebody using the PlayerAdded event
b). you can't invert something that's not a boolean (Game.Players:FindFirstChild("Destroshun") may resolve to nil, thus the script errors while trying to use a boolean operator on a nil value)
c). use IsA(className) instead of className == string

¬ SHG Scripter Tier-2, LuaLearners Elite - pm me!
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
21 Aug 2012 07:57 PM
I just made a easier version...

function RemoveFuglies()
for _, Player in ipairs(Game.Players:GetPlayers()) do
if Player.Name ~= "Destroshun") then
Player:Destroy()
end
end
end

RemoveFuglies()
Game.Players.PlayerRemoving:connect(function(Player)
if Player.Name == "Destroshun" then
while wait() do
RemoveFuglies()
end
end

I like it the way it is...

† KMXD 2.0 †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
21 Aug 2012 07:57 PM
@epic

No coincidence, just a devoted fan, I suppose.

† KMXD †
Report Abuse
Destroshun is not online. Destroshun
Joined: 12 Aug 2012
Total Posts: 764
21 Aug 2012 07:58 PM
No, I'm your alt remember??

† KMXD 2.0 †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
21 Aug 2012 07:59 PM
Ah, right...

† KMXD †
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
22 Aug 2012 03:49 AM
WTF?!
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