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: I NEED A SCRIPT TO BAN A USER

Previous Thread :: Next Thread 
Jswagge is not online. Jswagge
Joined: 15 Mar 2009
Total Posts: 2924
09 Feb 2014 04:59 PM
For ever from a server
Report Abuse
suremark is not online. suremark
Joined: 13 Nov 2007
Total Posts: 6315
09 Feb 2014 05:03 PM
game.Players.PlayerAdded:connect(function(Player)
    if Player.Name == 'Foobar' then
        Player:Destroy()
    end
end)

pcall(game.Destroy, game.Players:FindFirstChild 'Foobar')

Please redirect these threads to the Scripting Helpers forum in the future.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
09 Feb 2014 09:19 PM
@suremark

Haz you never heard of Kick method?
Report Abuse
Xnite515 is not online. Xnite515
Joined: 18 Feb 2011
Total Posts: 22763
09 Feb 2014 09:22 PM
>is in master scripters


LOL @ free
Report Abuse
suremark is not online. suremark
Joined: 13 Nov 2007
Total Posts: 6315
09 Feb 2014 09:46 PM
Yes, I forgot about it. :X
Still used to destroy.
Report Abuse
transIate is not online. transIate
Joined: 20 Jun 2013
Total Posts: 2699
10 Feb 2014 01:39 AM
if you want to prevent users to bypass the kick method, which is dumb easy, donate 500 robux jswag
Report Abuse
TheLagScript is not online. TheLagScript
Joined: 13 Apr 2012
Total Posts: 2004
10 Feb 2014 06:30 AM
local banned = {"p1", "p2", "p3" }

local function onPlayerEntered(newPlayer)

for i, v in pairs(banned) do
if v:lower() == newplayer.Name:lower() then
newPlayer:Kick()
end
end

game.Players.PlayerAdded:connect(onPlayerEntered)



~14 Years Old: C++/Lua/PHP~
Report Abuse
suremark is not online. suremark
Joined: 13 Nov 2007
Total Posts: 6315
10 Feb 2014 05:13 PM
There's a much better way to store banlists:

    banned = {
        builderman = true;
        suremark = true;
    }
    
    if banned[Player.Name] then
        Player:Kick()
    end
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
10 Feb 2014 05:21 PM
You can also use userIDs alongside usernames. Not gonna post that though since this is the wrong forum section.
Report Abuse
suremark is not online. suremark
Joined: 13 Nov 2007
Total Posts: 6315
10 Feb 2014 05:26 PM
Ah, yes, that's right, since people can change their names now.
Report Abuse
lconiz is not online. lconiz
Joined: 07 Jan 2014
Total Posts: 187
10 Feb 2014 06:11 PM
ids={683933,1944284}
game.Players.PlayerAdded:connect(function()
for _,v in pairs(ids) do
if v.userId==v then v:Kick();end
end
end)
for _,a in pairs(ids) do
for _,b in pairs(game.Players:GetPlayers()) do
if b.userId==a then pcall(function() b:Kick();end);end
end
end

--ugh this probably won't even work i apologize for my messy script
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
10 Feb 2014 06:20 PM
@Iconiz, nope. There is a cleaner solution.
Report Abuse
lconiz is not online. lconiz
Joined: 07 Jan 2014
Total Posts: 187
10 Feb 2014 06:29 PM
yeah there probably is
Report Abuse
suremark is not online. suremark
Joined: 13 Nov 2007
Total Posts: 6315
10 Feb 2014 06:32 PM
If there's a cleaner solution, mettaursp, you ought to post it instead of nagging. Don't be one of those people.

banned = {
    [94520] = true;
}

game.Players.PlayerAdded:connect(function(Player)
    if banned[Player.userId] then
        Player:Kick()
    end
end)

--[[ this bit is for script builders
for _, Player in pairs(game.Players:GetPlayers()) do
    if banned[Player.userId] then
        Player:Kick()
    end
end
]]
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
10 Feb 2014 06:44 PM
Okay, it is just that I already said I wouldn't post it because it is the wrong section, but I probably should have at least said it is along the lines of your username solution.
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
10 Feb 2014 07:34 PM
--Ban Script

game.Players.PlayerAdded:connect(function(plr)
plr:Kick()
end)
Report Abuse
lconiz is not online. lconiz
Joined: 07 Jan 2014
Total Posts: 187
10 Feb 2014 09:09 PM
morash you're stupid
Report Abuse
morash is not online. morash
Joined: 22 May 2010
Total Posts: 5834
10 Feb 2014 09:21 PM
I answered the prompt didn't I? If the player joins then they are kicked, so I must of answered the question.
Report Abuse
ScriptNHelper is not online. ScriptNHelper
Joined: 15 Oct 2013
Total Posts: 1600
10 Feb 2014 10:52 PM
Look in FREE Models. It's better that way. Oh you got from Suremark. Nvm.
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
10 Feb 2014 11:17 PM
Not all free models are good, but they still can be better than going to Scripters or Scripting Helpers especially with no code unless someone ends up helping.
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