function onClicked() if script.Parent.Parent.Parent.Parent.Bread.Value<script.Parent.Bread.Value then return end if script.Parent.Parent.Parent.Parent.Bread.Value>=script.Parent.Bread.Value then script.Parent.Parent.Parent.Parent.Cash.Value+script.Parent.Earn.Value then return end end
it says a res line under the "+", please help also this is in a gui
You really should make variables for those very long paths. However, assuming those paths are correct, you're adding wrong. You're essentially doing this;
a = 1 b = 2 a+b
This is incorrect. When a variable is set to equal something, you must always do it with an =
sign. To add something to a variable, we use the following method;
variable = variable + number
We use an equal sign to set the variable to itself, plus a number. Remember, variables will always stand for something. If we set a variable to itself, then we are just setting it to whatever it already stands for. Then we add to what the variable already stands for, and make the variable equal to that.
a = 1 b = 2 a = a + b --Doing the same thing as, a = 3
A few other errors in your code, you have an extra then
on line 6 that you don't need, and the return
on line 8 is useless because nothing comes after that.
Locked by BlueTaslem
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?