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

Having troubles with Number Values

Asked by 10 years ago

I am posting this again, since I modified the Script, but anyways I tried this and it still won't work:

function onClicked()
    if script.Parent.Parent.Parent.Cookies.Number.Value == 100 then
        while true do
            wait()
            script.Parent.Parent.Parent.CPS.Numberr.Value = script.Parent.Parent.Parent.CPS.Numberr.Value + 0.3
            script.Parent.Parent.Parent.CPS.Text = script.Parent.Parent.Parent.CPS.Text + 0.3
wait(0.3)
script.Parent.Parent.Parent.Cookies.Text = script.Parent.Parent.Parent.Cookies.Text + 0.3
        end
    end
end
script.Parent.MouseButton1Click:connect(Click)

3 answers

Log in to vote
0
Answered by 10 years ago

I would just love to hear what kind of trouble you are having.

0
It's not that hard... Obviously I have TextLabels in the StarterGui, that hold a Number, and I am trying to make it so when you buy the Upgrade in the Shop, you buy it and it gives you 0.3 every second. xXScorpianKillerXx 25 — 10y
0
At least edit your question so the script is somewhat readable. Use the correct BBCode(?) format. Trioxide 79 — 10y
Ad
Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago
script.Parent.Parent.Parent.CPS.Text + 0.3 wait(0.3) 
Parent.Parent.Cookies.Text = script.Parent.Parent.Parent.Cookies.Text 

You can't add a number Value in a string value maybe you can do this.

or -- you can do this
 z = Instance.new("Intvalue")
z.Parent = game.Workspace
z.Value = 1
script.Parent.Parent.Parent.CPS.Text = "What ever you want here"..z.Value

Then simply add to the int value and it will show on the text. Same with the other mistakes you made.

0
Alright, I will try that. xXScorpianKillerXx 25 — 10y
0
I updated it. Made an error myself I think. HexC3D 830 — 10y
0
Updated Again, Man I should check all my scripts before posting.. HexC3D 830 — 10y
Log in to vote
-1
Answered by 10 years ago

Also, all the Value's are NumberValue's.

0
This section is for answers, if you need to make an edit there is a button for it, and if not you can comment. Aethex 256 — 10y

Answer this question