Forum > General >

Kick a player when it says a specific word.

Posts: 3

Threads: 2

Joined: Jul, 2020

Reputation: 0

Posted

local filter = nil

local nilRep = ''

local blacklistedWords = {

    'addwordshere'

}

-- for string patterns (for filter) https://developer.roblox.com/en-us/articles/string-patterns-reference

 

local Player = game.Players.LocalPlayer

Player.Chatted:Connect(function(msg)

       local args = msg:split(' ')

       if filter then

           for i,v in pairs(args) do

               for a,b in pairs(blacklistedWords) do

                   if v:lower():gsub(filter,nilRep):match(a:lower()) then

                       Player:Kick('\n\nracist')

                   end

               end

           end

       elseif not filter then

           for i,v in pairs(args) do

               for a,b in pairs(blacklistedWords) do

                   if v:lower():match(a:lower()) then

                       Player:Kick('\n\nracist')

                   end

               end

           end

       end

end)

 

  • 0

Added

@SUPERSMASHERBROS no one cares

  • 0

well this is a bit silly innit?

 

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )