How do i detect tool holding left mouse button and leaving it?
Like
if player holding the left mouse button it print anything if leaves left mouse button prints anything again
This is one way of doing it. Keep in mind this is meant to be in a local script, so if you're making a gun, you need a separate server script to make the shooting function.
--- Localscript! UserInputService.InputBegan:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then print("Held down") end end) UserInputService.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton1 then print("Not held down") end end)