I’m trying to get a label to equal the value from a String Value
script.Parent.DescriptionFrame.NameLabel.Text = theTroop.TroopName.Value
I tried it, but it didn’t work. I then realized it was probably because theTroop.TroopName.Value
was a reference, and therefore the text couldn’t become it. Is there a way to get the value inside theTroop.TroopName.Value
itself, and then make the label have that text? I’m sorry if this is a dumb question lol.
1 Like
script.Parent.DescriptionFrame.NameLabel.Text = tostring(theTroop.TroopName.Value)
This may not fix your problem 100%, or it might, but either way, you should always convert values into strings, if it is an IntValue, or NumberValue, or any other value that can be used as a string. (Not a value like a boolean, etc…)
1 Like
Are you sure troopName is a string value and not an instance value?
If it is an instance you can add a .Name to get the string.
What is the error?
Doing typeof() will greatly help reduce these type errors.
CommanderBot, your the best lol
1 Like