local HttpService = game:GetService("HttpService")
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(message)
local msg = tostring(message)
local score = HttpService:GetAsync("https://not-showing-you-the-url.com/?m=" .. msg)
score = HttpService:JSONDecode(score).score
if tonumber(score) < 0 then
plr:Kick()
end
end)
end)
game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents").SayMessageRequest.OnServerEvent:Connect(function(plr,mes,target)
-- Loop through blacklisted words
if blacklistedWordFound then
plr:Kick("Stop exploiting.")
end
end)
I’m pretty sure .Chatted accounts for when they send the event anyways, but I’m not sure. I hope this helps you!
You can simply check if that event is fired from server.
game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents"):WaitForChild("SayMessageRequest").onServerEvent:Connect(function(player,message,channel)
-- Your checking stuff
end)
Full code
local HttpService = game:GetService("HttpService")
game:GetService("ReplicatedStorage"):WaitForChild("DefaultChatSystemChatEvents"):WaitForChild("SayMessageRequest").onServerEvent:Connect(function(plr,message,channel)
local msg = tostring(message)
local score = HttpService:GetAsync("https://not-showing-you-the-url.com/?m=" .. msg)
score = HttpService:JSONDecode(score).score
if tonumber(score) < 0 then
plr:Kick()
end
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(message)
local msg = tostring(message)
local score = HttpService:GetAsync("https://not-showing-you-the-url.com/?m=" .. msg)
score = HttpService:JSONDecode(score).score
if tonumber(score) < 0 then
plr:Kick()
end
end)
end)