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
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)
ty
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
This is not a script request site, you need to atleast try it yourself and if that dont work then show us what you have done and we can help you correct it