Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Team Color Script help?

Asked by 10 years ago
script.Parent.Touched:connect(function(hit)

    local player = game.Players:GetPlayerFromCharacter(hit.Parent)

    if player.TeamColor == "Bright blue" then
        print("blue")
    end

end)

Why doesn't this script work?

1 answer

Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
10 years ago
script.Parent.Touched:connect(function(hit)

    local player = game.Players:FindFirstChild(hit.Parent.Name) -- I just use this.. I find it to be easier :D

    if player.TeamColor == "Bright blue" then
        print("blue")
    end

end)

Ad

Answer this question