local RaidCommand = "/BeginRaid" local function onPlayerChatted(player, message, recipient) if message:sub(1, RaidCommand:len()):lower() == RaidCommand:lower() then script.Parent.Visible = true script.Parent.Parent.Background.Visible = true script.Parent.Visible = false wait(4) script.Parent.Parent.Background.Visible = false script.Parent.Visible = true end end local function onPlayerAdded(player) player.Chatted:Connect(function(...) onPlayerChatted(player, ...) end) end Players.PlayerAdded:Connect(onPlayerAdded)
This should help:
game:GetService("Players").PlayerAdded:Connect(function(player) player.PlayerChatted:Connect(function(message) if message == "[Put your message here]" then -- Do stuff -- end end) end)