vikingboy
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 1219 |
|
|
| 11 Jun 2014 09:04 PM |
Hi, I'm trying to make a game somewhat like Cookie Clicker. You see, when I spam click the button that adds points, it works to an extent, then it stops functioning (the script shuts down).
The script is still disabled = false though.
Any thoughts ideas? Input would be helpful.
Cheers, |
|
|
| Report Abuse |
|
|
vikingboy
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 1219 |
|
| |
|
|
| 11 Jun 2014 09:15 PM |
| you can pcall the functions if you plan on going that fast. Or you can use a slight debounce. I can't tell because there is no script posted... |
|
|
| Report Abuse |
|
|
vikingboy
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 1219 |
|
|
| 11 Jun 2014 09:29 PM |
Here, can you help me out?
function Click(mouse) script.Parent:TweenPosition(UDim2.new(script.Parent.Position.X.Scale, 0, -2, 0),"Out","Quad",.5) script.Parent.Size = (UDim2.new(0.15,0,1,0)) wait(.5) script.Parent.Visible = false script.Parent.Parent.Parent.cash.Value = cash + swipeval*50 end
script.Parent.MouseButton1Down:connect(Click)
--> I have no idea what the pcall function you are talking about, may you use it in a example? Thank you so much! |
|
|
| Report Abuse |
|
|
vikingboy
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 1219 |
|
| |
|
| |
|
vikingboy
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 1219 |
|
|
| 11 Jun 2014 10:03 PM |
@Legendary
How can I do that?
I'm sorry, I'm just a beginner!
Thank you so much for your help! |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 10:05 PM |
Heres debounce added
Local debounce = false
function Click(mouse) if not debounce then
script.Parent:TweenPosition(UDim2.new(script.Parent.Position.X.Scale, 0, -2, 0),"Out","Quad",.5) script.Parent.Size = (UDim2.new(0.15,0,1,0)) wait(.5) script.Parent.Visible = false script.Parent.Parent.Parent.cash.Value = cash + swipeval*50
buttonPressed = false end end
script.Parent.MouseButton1Down:connect(Click) |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 10:09 PM |
also heres a wiki for debounce
http://wiki.roblox.com/index.php?title=Debounce
All you need is
local debonce = true -------varibles------------
--function if not debounce then
--your code you dont want to be run multiple times over itself
debonce = false end |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2014 10:13 PM |
Much typos
"dobonce" was ment to be debounce >.< |
|
|
| Report Abuse |
|
|
vikingboy
|
  |
| Joined: 25 Apr 2008 |
| Total Posts: 1219 |
|
|
| 11 Jun 2014 10:26 PM |
Still not working - it seems to be worse now..
any advice? |
|
|
| Report Abuse |
|
|
| |
|