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

Having troubles with Number Values

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

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

2 comments

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.

0

At least edit your question so the script is somewhat readable. Use the correct BBCode(?) format.

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.

3 comments

0

Alright, I will try that.

0

I updated it. Made an error myself I think.

0

Updated Again, Man I should check all my scripts before posting..

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

1 comment

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.

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