Advertisement
Guest User

roblox ban

a guest
Aug 3rd, 2015
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. local Table = {"xDarkScripter", "SavageMunkey"} -- Here, we create a table that has information about all banned players, simply add more names and change them.
  2.  
  3. local function CheckBanned(PlayerName) -- New function with one argument.
  4. for Number, Object in pairs(Table) do -- Going throught all data.
  5. if Object == PlayerName then -- Checking if the PlayerName matches with one of the names in the table.
  6. return true --Returning information to the point where the function is called.
  7. end
  8. wait() -- Preventing to crash, always do this for long loops. (this one is small thought)
  9. end
  10. return false -- Doing the same as on line 6, but if it has already returned something it automatically stops going throught the other parts of the table and it will not come to execute to line 10.
  11. end
  12.  
  13. Game.Players.PlayerAdded:connect(function(Player) -- Event that activates a function with one arguent.
  14. if CheckBanned(Player.Name) == true then -- Checking if the player is banned with the function that starts on line 3.
  15. Player:Kick() -- Removing the player.
  16. end -- Closing if that starts at line 14.
  17. end) -- Closing a function.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement