|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 17 Nov 2013 11:13 PM |
| Why use :Destroy() when :Kick() works so much better? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| Joined: 28 Feb 2010 |
| Total Posts: 3154 |
|
|
| 17 Nov 2013 11:49 PM |
| This was made a long time ago.... |
|
|
| Report Abuse |
|
|