Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.