Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

When you say Somthing you Get Kicked? Answerd

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

✓ Accepted answer
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)

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)

1 comment

0

I give up. I keep on getting downvoted by noobs.

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

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.

@1518

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

1 comment

0

@CrazyRocker60, Isn't there are Comment Section?

This discussion is preserved as it was. New answers, comments, and votes are closed.