Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

When you say Somthing you Get Kicked? Answerd

Asked by 10 years ago

I need a Script For my Game So Like This If some One Says a Bad Word I can make a List In a Script And If the Word is there It Kicks the Player Like this

Say "bad word" It will kick you

Can Ya Help Me with this?

Thanks! :P

5 answers

Log in to vote
2
Answered by 10 years ago
local list = {"Example1", "Example2"} --Contains inappropriate words.
function checkString(message)
    for i,v in pairs(list) do --Go through the list
        if v:lower() == message:lower() then --Check if the message is the same as a word in the list
            return true
        end
    end
end

Game.Players.PlayerAdded:connect(function(Player) --When a player joins
    Player.Chatted:connect(function(Message) --When the player chats
        if checkString(Message) then --If what they chatted was inappropriate
            Player:Kick() --Kick them from the game.
        end
    end)
end)
Ad
Log in to vote
1
Answered by
Nickoakz 231 Moderation Voter
10 years ago

Here is a script that will kill the player if they say any word in the table.

local words={"scam","noob","n00b"}
function Chat(m,p)
    local m=m:lower()
    for a=1,#words do
        if string.find(words[a],m) then
            p.Character:BreakJoints()
        end
    end
end
local all=game.Players:getChildren()
for a=1,#all do all[a].Chatted:connect(function(m) Chat(m,all[a]) end) end
game.Players.PlayerAdded:connect(function(p) p.Chatted:connect(function(m) Chat(m,p) end) end)
0
I give up. I keep on getting downvoted by noobs. Nickoakz 231 — 10y
Log in to vote
1
Answered by 10 years ago

Ehh... ROBLOX supplys that script! you only need to go into game stuff in inventory, and find it at the top!

Log in to vote
0
Answered by
ultrabug 306 Moderation Voter
10 years ago
local words={"Fiddlesticks", "Fudge", "Hi"}--list of unwanted words.
game.Players.PlayerAdded:connect(function(np)--when a new player joins, this will run.
    np.Chatted:connect(function(msg)--when the player chats, this will run.
        for i,v in pairs(words)do--goes through all of the words making them basically into one value but contains multiple values.
            if msg==v then--checks if the msg is a unwanted word.
                np:Kick()--kicks the player.
            end
        end
    end)
end)

This is a crude version but may help you somewhat.

Log in to vote
-4
Answered by 10 years ago

@1518

Wouldn't that break your joints, and only kill them?

0
@CrazyRocker60, Isn't there are Comment Section? AIphanium 124 — 5y

Answer this question