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

I keep getting an error for an attempt to call field 'Value' (a number value). How do I fix?

I made want it to combine a percentage of something. If I remove the percentage part, it works? Although if it's there, I get this error: attempt to call field 'Value' (a number value).

This is the script:

script.Parent.Text = "Pollution Levels : " .. workspace.GlobalStats.Pollution.Value "%"

1 answer

✓ Accepted answer

Try using

script.Parent.Text = "Pollution Levels : "..workspace.GlobalStats.Pollution.Value.."%"

What you did was you did was:

string..num string

instead of string..num..string

(You forgot to connect the string with ".." and used " " instead)

Also, you put spaces in between the values and ".." don't know if it changes anything but it's unnecessary

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