Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to add a symbol in front of a value in a text label?

Asked by
Echtic 128
5 years ago

This is the important part of the code

script.Parent.Text = plr.PlayerStats.MeleeExp.Value / plr.PlayerStats.MaxMeleeExp.Value * 100

I want to add a % symbol after this value

0
in the end do this * 100.."%" .. means followed by and since % is not a value u need the speechmarks Gameplayer365247v2 1055 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
script.Parent.Text =  tostring(plr.PlayerStats.MeleeExp.Value / plr.PlayerStats.MaxMeleeExp.Value * 100).."%"

You can use "tostring" to transform a value into text. Then, use ".." to add the percentage character.

0
Thanks a lot good sir! Echtic 128 — 5y
Ad

Answer this question