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 code for this?

Previous Thread :: Next Thread 
QuarterTerm is not online. QuarterTerm
Joined: 29 Jun 2013
Total Posts: 6795
17 Nov 2013 10:28 PM
Is there a code for banning a person?

Instead of the mainstream removal [ game.Players["NameHere"]:remove() ] how can I ban someone and not let them in the server? Is that possible without inserting a script?

You just got Quarter-Term'd
Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
17 Nov 2013 10:40 PM
Rem25's ban script:


BannedPlayers = {"Name of player here", "Another name of player","so on"}

game.Players.PlayerAdded:connect(function(player)
repeat wait() until Player.Character
for k,v in pairs (BannedPlayers) do
if player.Name == v then
Player:Destroy()
end
end
end)


Some parts you might want to fix in case it doesnt work....long time since I made this

Report Abuse
madness725 is not online. madness725
Joined: 19 Apr 2011
Total Posts: 2058
17 Nov 2013 10:41 PM
If your in personal server mode, you click there name on the leaderboard. And there should be a ban button.
Report Abuse
mic144 is not online. mic144
Joined: 14 Oct 2009
Total Posts: 1598
17 Nov 2013 10:42 PM
anything is possible if you just believe hard enough :D

-- $$ Get on my level, here use this ladder. Don't fall down on the way up! $$ --
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
17 Nov 2013 11:13 PM
Why use :Destroy() when :Kick() works so much better?
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
17 Nov 2013 11:18 PM
Also your banscript is bad as you have to enter in the exact username.
A better one'd be;

local banland = {}
group_ban, banned_group = false, 1231
function ban(player)
for I, v in next, banland do
if player.Name:lower() == v:lower() then
player:Kick()
end
if group_ban and player:IsInGroup(banned_group) thenplayer:Kick()
end
end
end

game.Players.PlayerAdded:connect(function(player)
ban(player)
end)
Report Abuse
flatline115 is not online. flatline115
Joined: 29 Jul 2013
Total Posts: 7826
17 Nov 2013 11:19 PM
Sorry I misplaced a method.


local banland = {}
group_ban, banned_group = false, 1231
function ban(player)
for I, v in next, banland do
if player.Name:lower() == v:lower() then
player:Kick()
end
if group_ban and player:IsInGroup(banned_group) then
player:Kick()
end
end
end

game.Players.PlayerAdded:connect(function(player)
ban(player)
end)

Report Abuse
REM25 is online. REM25
Joined: 28 Feb 2010
Total Posts: 3154
17 Nov 2013 11:49 PM
This was made a long time ago....
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