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

How do I make a TextBox number rise by a number in another TextBox?

Ever heard of make it rain? Try to remember this concept while helping me. I am trying to make a Pickles Per Second like 'Money per second' Here is what I have tried so far.

P = script.Parent.Parent.Parent.Pickles.Text
L = script.Parent.Value
N = 0

while true do
	N = P + L
	wait(1)
	local str = script.Parent.Parent.Parent.PPS.Text;
	local lel = tonumber(str:match("^%d+"));

	script.Parent.Parent.Parent.Pickles.Text = N .. " Pickles"

end

2 comments

0

Pickles.Text = script.Parent.Value.." Pickles"

0

Your problem is that you are only saving 'P' as a String, not a Number Value! Even so, on line 6, you'll still be attempting to compare a String to a Number Value. Consider using 'tonumber'?

1 answer

Go with what TheAlphaStigma said and use

 N = P.tonumber + L

Alpha said Your problem is that you are only saving 'P' as a String, not a Number Value! Even so, on line 6, you'll still be attempting to compare a String to a Number Value. Consider using 'tonumber'?

ALL CREDIT GOES TO ALPHA!

1 comment

0

That still doesnt work...

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