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
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)
Thanks! It worked! I really appreciate the help.
In a serverscript:
script.Parent.Touched:Connect(function()
if player.Team.Name == "Red" then
-- scripts that you do not need to read
end
end)
Attempt to index nil with "Team"
local player = game.Players.LocalPlayer
if player.TeamColor == "Really Red" then
-- scripts that you do not need to read
end
CHANGE REALLY RED TO THE TEAM BRICKCOLOR!!!!!!!!!
Attempt to index nil with "TeamColor"
This discussion is preserved as it was. New answers, comments, and votes are closed.
3 comments
is ro was?
What do you mean?
He asked "is or was?" like is in the team currently or was in the team previously?