D
D
Dima2021-06-26 19:39:25
Lua
Dima, 2021-06-26 19:39:25

How to delay between clicks?

local clicks = game.Players.LocalPlayer.leaderstats.money 
script.Parent.MouseButton1Click:Connect(function()
  clicks.Value += 1
  wait(1)
end)


I don't have any delay

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Ushakov, 2022-04-15
@Nightmare1

The first option is to get the value of the click time and compare it with the delay number. Let's say so

local clicks = game.Players.LocalPlayer.leaderstats.money 

clicks.delay = 10
script.Parent.MouseButton1Click:Connect(function()
  if ((clicks.click_time or 0) + clicks.delay) < GetCurrentTime() then
    clicks.click_time = GetCurrentTime()
    clicks.Value += 1
  end
end)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question