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

I'm new to scripting and i could use some help! How would I put a number value on a surface GUI?

Asked by 9 years ago

I am creating a storage for my "ore" on a tycoon (i figured a tycoon was the best place to learn scripting) but i want it to at least be a decent tycoon so i am adding storage.. anyways long story short*** i would like to know how to add a number value to a 'Surface GUI' or a 'TextLabel'*** Call me a noob but i'm just reaching out for some help :) any and all answers are thanked!

-SamKillz123

1 answer

Log in to vote
1
Answered by
Validark 1580 Snack Break Moderation Voter
9 years ago

To put a number on a SurfaceGui, just put a TextLabel inside it and set the Text property to whatever number you want.

If you want to increase that number, do the following:

TextLabel.Text = tostring((tonumber(TextLabel.Text) + 1))

If you have other things inside the string besides just the number, you can use a function from the string library.

I recommend string.sub() for this purpose.

0
THANK YOU! I have been looking everywhere for that one line of code! I can now continue my tycoon :) SamKillz123 5 — 9y
0
@SamzKillz123 If I answered your question, please hit accept answer. Upvote or downvote if you think it deserves one. Validark 1580 — 9y
Ad

Answer this question