So, whenever I play my game, the TextLabel says the players team. But when I stop the game, then play again, it just says the default text I set for it. If I keep playing then stopping, it still happens.
Here’s my script:
--Definitions Above this
game.Players.PlayerAdded:Connect(function(player)
if player.Team == game.Teams.Mayor then
wait(0.5)
RoleRevealText.Text = "Mayor"
RoleRevealText.TextColor3 = MayorColor
end
--Same script over and over for other teams
end)
If I understand your script correctly, you defined RoleRevealText as a TextLabel, but is it a TextLabel in the player’s PlayerGui? Or is it in the StarterGui? Changing the StarterGui’s TextLabel won’t update it in the player’s current PlayerGui, do something like this;
game.Players.PlayerAdded:Connect(function(player)
local RoleRevealText = player.PlayerGui["ScreenGui name here"].RoleRevealText
wait(0.5)
if player.Team == game.Teams.Mayor then
RoleRevealText.Text = "Mayor"
RoleRevealText.TextColor3 = MayorColor
end
end)