generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Shop GUI isn't working.

Previous Thread :: Next Thread 
sidekick601 is not online. sidekick601
Joined: 27 Feb 2012
Total Posts: 8734
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
sidekick601 is not online. sidekick601
Joined: 27 Feb 2012
Total Posts: 8734
06 May 2014 08:54 PM
bump
Report Abuse
greatgavin is not online. greatgavin
Joined: 20 Jul 2009
Total Posts: 389
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
sidekick601 is not online. sidekick601
Joined: 27 Feb 2012
Total Posts: 8734
07 May 2014 04:35 PM
Bump
Report Abuse
PlaceRebuilder is not online. PlaceRebuilder
Joined: 29 Apr 2008
Total Posts: 1056
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
sidekick601 is not online. sidekick601
Joined: 27 Feb 2012
Total Posts: 8734
07 May 2014 05:45 PM
I've got it down now, thanks rebuild.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image