I’m trying to set a variable in a function and then use it later in my script to change a nametag to display their rank, but when I set the value in the script it still shows up as nil when I try to print it. When the character is reset the rankName changes, but it’s color doesn’t.
Here’s what’s happening, and the code I’m using.
Code:
print(wins)
if wins < 5 then
rankName = "Newbie"
rankColor = Color3.new(42, 182, 131)
end
No, it seems like some other parts of your script are not working or something. Maybe your variables are getting overwritten or something. I don’t know.
It could also be possible that you are changing the variable in a LocalScript which is then not replicated to the Server if it checks the variable.