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

How do i make it so it doesnt look for input and waits till it does again?

Asked by 2 years ago
UIS.InputBegan:Connect(function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        mouseDetection:FireServer()
        wait(3)
    end
end)
0
Personally I'd use boolean for that NotThatFamouss 605 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

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)

0
It only runs once and doesnt run after thecoolguy436 38 — 2y
Ad

Answer this question