Scripting issue with if statement

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 ="RemoteEvent", game.ReplicatedStorage)
remote.Name = "ServerMessage"

for _, team in pairs(TeamsService:GetTeams()) do
		if ~= "Menu" then
			remote:FireAllClients("[System] " ..player.Name.. " has joined ", Color3.fromRGB(15, 179, 255), Enum.Font.Arial, Enum.FontSize.Size24)
			warn("Remote fired")


The issue is even though you are checking if someone is on a particular team, the FireAllClients() function will still fire the remote event to everyone in the game, meaning everyone will still see it happening. If I were you, I would loop through teams that you want to see the message, and then use FireClient() instead.

Kf637, the problem here is your conditional statement is checking if ~= "Menu" while it should be checking if ~= "Menu". Hope this helps!