BloXatoR

Advanced Scripting Techniques: Kick Toxic Players from Your Games | Roblox Tutorial 2023

May 27th, 2023
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | Gaming | 0 0
  1. -- Made by E4erZ, BloXatoR :)
  2. -- Your Welcome guys :)
  3.  
  4. local badWords = {"suck", "L", "apple", "trash"} -- use any types of words
  5.  
  6. game.Players.PlayerAdded:Connect(function(player)
  7.     local warningGiven = false -- Keeps track of whether a warning has been given to the player
  8.  
  9.     player.Chatted:Connect(function(msg)
  10.         for i, v in pairs(badWords) do
  11.             if string.find(msg:lower(), v:lower()) then
  12.                 if not warningGiven then
  13.                     player:Kick("Warning: Don't use bad words.")
  14.                     warningGiven = true
  15.                 else
  16.                     player:Kick("Kicked:bad words.")
  17.                 end
  18.             end
  19.         end
  20.     end)
  21. end)
  22.  
  23. --credit Twitch_E4erZyt, BloXatoR, E4erZ.
  24. --Leave a like and subscribe for more.
  25.  
  26. --SUBSCRIBE to E4erZ and BloXatoR..
Advertisement
Add Comment
Please, Sign In to add comment