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

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

Asked by 9 years ago

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

0
Pickles.Text = script.Parent.Value.." Pickles" EzraNehemiah_TF2 3552 — 9y
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'? TheeDeathCaster 2368 — 9y

1 answer

Log in to vote
0
Answered by
anerth 25
9 years ago

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!

0
That still doesnt work... My_Comment 95 — 9y
Ad

Answer this question