Jswagge
|
  |
| Joined: 15 Mar 2009 |
| Total Posts: 2924 |
|
| |
|
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 |
|
|
|
| 09 Feb 2014 09:19 PM |
@suremark
Haz you never heard of Kick method? |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 09 Feb 2014 09:22 PM |
>is in master scripters
LOL @ free |
|
|
| Report Abuse |
|
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 20 Mar 2010 |
| Total Posts: 3179 |
|
|
| 10 Feb 2014 06:20 PM |
| @Iconiz, nope. There is a cleaner solution. |
|
|
| Report Abuse |
|
|
lconiz
|
  |
| Joined: 07 Jan 2014 |
| Total Posts: 187 |
|
| |
|
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
|
  |
| 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
|
  |
| 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
|
  |
| Joined: 07 Jan 2014 |
| Total Posts: 187 |
|
| |
|
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 |
|
|
|
| 10 Feb 2014 10:52 PM |
| Look in FREE Models. It's better that way. Oh you got from Suremark. Nvm. |
|
|
| Report Abuse |
|
|
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 |
|
|