Hi Guys,
I have a script that will basically check if the player is not on the team named "Passenger". If they are not on it, it will print that they can spawn, whereas if they are on the team it will print that they cant spawn. Could someone help me because all it seems to do is just go to the else part and doesn't ever fulfill the if statement, even though i am 100% sure it does. Script is below, any advice would be great!
script.Parent.Spawn.TextButton.MouseButton1Click:Connect(function()
print(game.Players.LocalPlayer.Team)
if game.Players.LocalPlayer.Team ~= "Passenger" then
print("Can spawn bus")
else
print("Can NOT spawn bus")
end
end)

1 comment
You are comparing a Team instance to a string which will be false each time. If you are checking the name of the team then use .Name to get the string name.