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

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

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

✓ Accepted answer

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.

2 comments

0

THANK YOU! I have been looking everywhere for that one line of code! I can now continue my tycoon :)

0

@SamzKillz123 If I answered your question, please hit accept answer. Upvote or downvote if you think it deserves one.

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