UIS.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
mouseDetection:FireServer()
wait(3)
end
end)
✓ ANSWER ACCEPTED
How do i make it so it doesnt look for input and waits till it does again?
1 answer
✓ Accepted answer
Personally, I'd use boolean for delays.
local UIS = game:GetService("UserInputService")
local Delayed = false
local DelayTime = 3
UIS.InputBegan:Connect(function(input, GPE)
if not Delayed then -- if delayed is false
-- Code goes here
else -- If delayed is true
wait(DelayTime)
Delayed = false
end
end)
(Note: This script wasn't tested)
1 comment
0
It only runs once and doesnt run after
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Personally I'd use boolean for that