if playerMouse.Target.Parent.Owner.Value == player.Team then
When I print either of these values they both come out as blue. The Owner.Value is a string value within a model. An if statement doesn't come out true for some reason. I have printed and know that its doing
if blue == blue then
What is wrong with this?
I don't have much experience with Teams, but what I believe is happening is you're attempting to compare a string with an object. To fix this, try comparing the Value to Team.Name instead of Team.
When printing an object in roblox, the output lists its name, but the reference to the object is not actually the name. For instance, consider a part in the workspace named Part as well as a string variable Part:
local part = workspace.Part local partString = "Part" print(part, part.Name, partString) print(part == partString) print (part.Name == partString)
The first print statement would print (Part, Part, Part). However, the second statement would print out false, as it's not comparing the two directly. The third should work.