Hi! I'm making a tycoon and I ran into a problem. I wanted to make the player only touch the button if he was in the right team and I used this and it doesn't work:
if player.Team.Red then -- scripts that you do not need to read end
script.Parent.Touched:Connect(function(hit) local player = game.Players:FindFirstChild(hit.Parent.Name) if not player then return end if player.Team.Name == "Red" then -- scripts that you do not need to read end end)
In a serverscript:
script.Parent.Touched:Connect(function() if player.Team.Name == "Red" then -- scripts that you do not need to read end end)
local player = game.Players.LocalPlayer if player.TeamColor == "Really Red" then -- scripts that you do not need to read end