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

How to make a person click a certain amount of times before an action happens?

Asked by 7 years ago

how do you make it so a person would have to click a few times before there is an action that happens

0
please attempt this before posting aztec_glory 63 — 7y
0
i have attempted it many times that why im posting it on here kevinliwu1 9 — 7y
0
Well, use click events and every time they click add to a number variable called "Clicks" then check if Clicks == <Amount of Times to Click Before Action> then if so do this. Nidoxs 190 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
Edited 7 years ago
local clicks = 0
local mouse = game.Players.LocalPlayer:GetMouse()

mouse.Button1Down:connect(function()
    clicks = clicks + 1

    if clicks == 5 then
        print("Five clicks have been made!")
        clicks = 0 -- Resets the click count.
    end
end)
Ad

Answer this question