|
| 06 May 2014 08:38 PM |
Suppose I have a GUI button in a frame where when you click it and you have 80 or more points, your get subtracted 80 points, and given 2 clicks every 1 second.
(Hint: Game i'm working on is sort of cookie clicker if that helps you imagine)
If you do not have 80 pts it says, "Sorry you do not have enough funds" that works well. But when I got to 80 pts it kept saying that? I'm not sure what the problem is... Output says nothing.
TL;DR: Shop isn't working.
Script below:
yourPts = script.Parent.Parent.Parent.Parent.ClickButton.forShop Pts = yourPts.Value auto1 = script.Parent
script.Parent.MouseButton1Down:connect(function(buyAutoClickerOne) if yourPts.Value > 80 then yourPts.Value = Pts - 80 while true do wait(1) yourPts.Value = Pts + 2 end elseif yourPts.Value < 80 then do auto1.Text = "Sorry, you do not have enough funds." wait(3) auto1.Text = "Auto-Clicker #1 (2 Clicks Per Second)" end end
end) |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 May 2014 09:29 PM |
> means more than, not equal to => means more than or equal to
If it's more than 80 points then it will work, if it's equal it will not. |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 May 2014 05:13 PM |
-Pts = yourPts.Value this will set Pts to your points value at the start of the script
-if yourPts.Value > 80 then -yourPts.Value = Pts - 80 -while true do -wait(1) -yourPts.Value = Pts + 2
Pts is always same value. if you had 90 from the start then Pts is 90 points here too. nomather howmany times u run this.
Correct lines would be (erase Pts variable completly): if yourPts.Value > 80 then yourPts.Value = yourPts.Value - 80 while true do wait(1) yourPts.Value = yourPts.Value + 2 end end
|
|
|
| Report Abuse |
|
|
|
| 07 May 2014 05:45 PM |
| I've got it down now, thanks rebuild. |
|
|
| Report Abuse |
|
|