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

TextLabel not going invisible after checking if localplayer is on certain team?

Asked by 4 years ago

I'm fairly new to scripting and I'm trying to make a localscript where when it runs the script checks to see if the localplayer is on a certain team (BlueTeam in this case) and then waiting 2 seconds before making the textlabel invisible.

I'm not getting any errors in Output but the script isn't working.

player = game.Players.LocalPlayer
blueText = player.PlayerGui.ScreenGui.Blue.BlueText


function myFunction()
    if player.Team == 'BlueTeam' then wait(2)
        blueText.Visible = false
    end
end

myFunction()

1 answer

Log in to vote
0
Answered by 4 years ago

Nevermind, I figured it out.

I changed line 6 from

if player.Team == 'BlueTeam' then wait(2)

to

if player.TeamColor == BrickColor.new("Bright blue") then wait(2)
Ad

Answer this question