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

When they activate it and click 2 times I want it to print something but not working?

Asked by 5 years ago

it gives me a error

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local starterPack = game:GetService("StarterPack")
local tool = starterPack:WaitForChild("Tool")
clicks = 0
if tool then
    tool.Activated:Connect(function()
        if mouse.MouseButton1Click then
            clicks = clicks + 1
        end
    if clicks == 2 then
        print("Clicked two times.")
    end
    end)
end

the error is 09:02:22.129 - MouseButton1Click is not a valid member of PlayerMouse

1 answer

Log in to vote
1
Answered by 5 years ago

Instead of using MouseButton1Click, try using Button1Down

Ad

Answer this question