Alright so i am trying to get my custom chat to say when a player kicks another player from the game but it is not doing anything when that happens not even the warn() i put the whole custom chat script just in case all of it was needed for some reason
InvokeScript:
game.ReplicatedStorage.RemoteTests.Kick.OnServerEvent:Connect(function(player,reason,stringvalue)
local brunomars = game.Players:FindFirstChild(stringvalue)
if brunomars == nil then
warn(stringvalue.." Is Not A Player".." : Sent By "..player.Name)
elseif stringvalue == "Donut792" then
player:Kick("Outstanding Move")
else
brunomars:Kick(reason)
local Player = player.Name
game.ReplicatedStorage.DoneMessedUp:Invoke(Player,stringvalue)
end
end)
OnInvokeScript:
local chats = script.Parent.Chats
local last
function newChat(filteredTextResult,plr)
local plrid = plr.UserId
if #filteredTextResult > 0 then
for i, c in pairs(chats:GetChildren()) do
c.Position = c.Position - UDim2.new(0, 0, 0.1, 0)
end
local newMessage = script.Message:clone()
if #chats:GetChildren() == 10 then
chats:GetChildren()[1]:Destroy()
end
game.ReplicatedStorage.DoneMessedUp.OnInvoke = function(Player,stringvalue)
warn(Player.." Kicked "..stringvalue)
for i, c in pairs(chats:GetChildren()) do
c.Position = c.Position - UDim2.new(0, 0, 0.1, 0)
end
local newMessage = script.Message:clone()
if #chats:GetChildren() == 10 then
chats:GetChildren()[1]:Destroy()
end
newMessage.Text = "[CONSOLE] " .. Player .. " Kicked " .. stringvalue
newMessage.TextColor3 = script["Ban/Kick"].Value
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
end
if plrid == 38270341 then
newMessage.TextColor3 = script.Owner.Value
newMessage.Text = "[OWNER] " .. plr.Name ..": ".. filteredTextResult
elseif plrid == 291995028 or plrid == 131541716 or plrid == 41163273 or plrid == 291995028 or plrid == 939385688 or plrid == 552452701 or plrid == 132007993 then
newMessage.TextColor3 = script.Admin.Value
newMessage.Text = "[ADMIN] " .. plr.Name ..": ".. filteredTextResult
elseif game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plrid,5665608) then
newMessage.TextColor3 = script.VIP.Value
newMessage.Text = "[VIP]" .. plr.Name ..": ".. filteredTextResult
-- while wait() do
-- newMessage.TextColor3 = Color3.new(255/255,0/255,0/255)
-- for i = 0,255,10 do
-- wait()
-- newMessage.TextColor3 = Color3.new(255/255,i/255,0/255)
-- end
-- for i = 255,0,-10 do
-- wait()
-- newMessage.TextColor3 = Color3.new(i/255,255/255,0/255)
-- end
-- for i = 0,255,10 do
-- wait()
-- newMessage.TextColor3 = Color3.new(0/255,255/255,i/255)
-- end
-- for i = 255,0,-10 do
-- wait()
-- newMessage.TextColor3 = Color3.new(0/255,i/255,255/255)
-- end
-- for i = 0,255,10 do
-- wait()
-- newMessage.TextColor3 = Color3.new(i/255,0/255,255/255)
-- end
-- for i = 255,0,-10 do
-- wait()
-- newMessage.TextColor3 = Color3.new(255/255,0/255,i/255)
-- end
-- end
else
newMessage.Text = plr.Name ..": ".. filteredTextResult
end
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
end
end
function join(plr)
for i, c in pairs(chats:GetChildren()) do
c.Position = c.Position - UDim2.new(0, 0, 0.1, 0)
end
local newMessage = script.Message:clone()
if #chats:GetChildren() == 10 then
chats:GetChildren()[1]:Destroy()
end
if plr.UserId == 38270341 then
newMessage.Text = "[CONSOLE] " .. plr.Name .. " joined the server!"
newMessage.TextColor3 = script.OwnerJoin.Value
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
else
newMessage.Text = "[CONSOLE] " .. plr.Name .. " joined the server!"
newMessage.TextColor3 = script.CONSOLE.Value
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
end
end
function left(plr)
for i, c in pairs(chats:GetChildren()) do
c.Position = c.Position - UDim2.new(0, 0, 0.1, 0)
end
local newMessage = script.Message:clone()
if #chats:GetChildren() == 10 then
chats:GetChildren()[1]:Destroy()
end
if plr.UserId == 38270341 then
newMessage.Text = "[CONSOLE] " .. plr.Name .. " left the server!"
newMessage.TextColor3 = script.OwnerJoin.Value
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
else
newMessage.Text = "[CONSOLE] " .. plr.Name .. " left the server."
newMessage.TextColor3 = script.CONSOLE.Value
newMessage.Position = UDim2.new(0, 0, 0.9, 0)
newMessage.Parent = chats
last = newMessage
end
end
game.Players.PlayerAdded:Connect(function(plr)
join(plr)
end)
game.Players.PlayerRemoving:Connect(function(plr)
left(plr)
end)
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
local id = plr.UserId
local Chat = game:GetService("Chat")
local filteredText = "TextHolder"
local errorMessage = "whoops"
local success, errorMessage = pcall(function()
local filteredTextResult = Chat:FilterStringForBroadcast(msg, plr)
filteredText = filteredTextResult
end)
if not success then
warn("Error filtering text on second:", msg.." to ".."filteredText"..":", errorMessage)
end
newChat(filteredText, plr)
end)
end)
for i, player in pairs(game.Players:GetPlayers()) do
player.Chatted:Connect(function(msg)
local id = player.UserId
local Chat = game:GetService("Chat")
local filteredText = "TextHolder"
local errorMessage = "whoops"
local success, errorMessage = pcall(function()
local filteredTextResult = Chat:FilterStringForBroadcast(msg, player)
filteredText = filteredTextResult
end)
if not success then
warn("Error filtering text on second:", msg.." to ".."filteredText"..":", errorMessage)
end
newChat(filteredText, player)
end)
end
--local Player = "Donut792" local stringvalue = "FJKL" game.ReplicatedStorage.DoneMessedUp:Invoke(Player,stringvalue)
i have thought about putting the kick script inside the chat module instead of my AdminHandler script

7 comments
Why are you using bindables like they are remot events?
Also, -- [[ ]] is much easier than manually commenting out 25 lines of code.
@DinozCreates you just select the lines in studio then right click to comment them out
Oh wow theres a shortcut? Ill have to play with that once i have studio access. I still think using the other method is a much cleaner way of commenting out. Even if it takes the same amount of time.
bindable events are for communicating server to server or client to client and remote events are for communicating client to server or server to client. To totally different things
its server to server
ok