Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to fix Button delay?

Asked by
Eppobot 13
8 years ago

So when i click my button, there is huge delay, and it is super annoying. Can someone tell how to fix that?

function onButtonClicked()

script.Parent.Position= UDim2.new(0,0,0.007,0)
script.Sound:Play()
wait(0.2)
script.Parent.Position= UDim2.new(0,0,0.0,0)

end

  script.Parent.MouseButton1Click:connect(onButtonClicked)

1 answer

Log in to vote
1
Answered by
Fatul 9
8 years ago

At first look you have an error on line 5 at the wait "(0,2)". It should be wait(0.2)

One thing to note is that errors will completely stop your script.

0
i Fixed it. But delay is still there. Eppobot 13 — 8y
0
Remove the wait then! Fatul 9 — 8y
Ad

Answer this question