I’m making a script that will send a message in chat when a player joins a team and I want it to ignore one of the teams so I used an if statement but it still gets triggered and I’m not sure how.
This is the code
local TeamsService = game:GetService("Teams")
local remote = Instance.new("RemoteEvent", game.ReplicatedStorage)
remote.Name = "ServerMessage"
for _, team in pairs(TeamsService:GetTeams()) do
team.PlayerAdded:connect(function(player)
if player.team ~= "Menu" then
remote:FireAllClients("[System] " ..player.Name.. " has joined " ..team.Name, Color3.fromRGB(15, 179, 255), Enum.Font.Arial, Enum.FontSize.Size24)
warn("Remote fired")
end
end)
end