I am making an anti swear script for my game. This following anti swear script isn’t working.
game.Players.LocalPlayer = game:GetService(“PlayerService”)
local message = (“Swear word”)
when saidMessage = true do
Player:Kick(“Swearing isn’t tolerated!”)
end
local msg = "heck"
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(m)
if m == msg then
player:Kick("you swore")
end
end)
end)
your code dosen’t even detect when someone chats, neither does it even declare saidMessage, learn more lua before attempting this
The Code Review category is only for asking for help on improving code that already works. If you are trying to resolve a programming issue, use the Scripting Support category. Please read category guidelines before posting threads on the DevForum.
Roblox filtering should be enough to handle this. Though with @ekuz0diaa 's approach, it’s very simple to get around it. Even with Roblox’s intense filtering, people can find ways around it. As well there are issues with filtering that could flag innocent words as bad words just because a bad word is within the innocent word. I would just let Roblox text filtering do it’s job.