Trfe2000
|
  |
| Joined: 23 Apr 2016 |
| Total Posts: 73 |
|
|
| 23 Aug 2017 11:26 AM |
Is there a way to ban people from your game? I couldn't really make much sense out of the wiki.. If there is a way then also how can you do it? I would very much appreciate your help!! |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2017 11:28 AM |
local banlist = {}
game.Players.PlayerAdded:Connect(function(plr) for i = 1, #banlist do if banlist[i] == plr.Name or plr.UserId then plr:Kick("You have been banned.") end end end)
╴ “I seem to get mentioned alot in videogames.. i wonder why..” |
|
|
| Report Abuse |
|
|
|
| 23 Aug 2017 11:29 AM |
Yes, you can ban people from your game, but it's not the traditional style of banning as they can still technically join your game.
Basically, make a datastore and store a value that lets the game know if the player joining is banned or not. If they are, kick them!
#code error("Signature not found!") |
|
|
| Report Abuse |
|
|
Trfe2000
|
  |
| Joined: 23 Apr 2016 |
| Total Posts: 73 |
|
|
| 23 Aug 2017 11:31 AM |
| Ah ok! I understand it now thanks a lot! |
|
|
| Report Abuse |
|
|
RobuxLife
|
  |
| Joined: 19 Sep 2012 |
| Total Posts: 13336 |
|
|
| 23 Aug 2017 11:34 AM |
Use a DataStore. Reason why? It can be used across Universes in your game, and you won't have to re-add the list each time.
|
|
|
| Report Abuse |
|
|
DrellCCK
|
  |
| Joined: 30 Jun 2017 |
| Total Posts: 130 |
|
| |
|
Trfe2000
|
  |
| Joined: 23 Apr 2016 |
| Total Posts: 73 |
|
|
| 23 Aug 2017 11:38 AM |
| Yes I understand. Thx a lot! |
|
|
| Report Abuse |
|
|