I don't think there is a way to know, but there is another way to do. We can check if the player is holding the mouse with tool.Activated and tool.Deactivated to a boolvalue:
local tool = script.Parent > the script's parent is the tool
local HodingMouse = script.Parent.HoldingMouse > you have to insert a boolvalue named "HoldingMouse" in the the tool so the script can detect automatically after the holdingmouse's value becomes true instead of doing a "while wait(.5)"
tool.Activated:Connect(function()
HoldingMouse.Value = true
end)
tool.Activated:Connect(function()
HoldingMouse.Value = false
end)
script.Parent.HoldingMouse.Changed:Connect(function()
if script.Parent.HoldingMouse.Value == true then
repeat
> FIRES THE GUN
wait(.5) > THE GUN HAS TO WAIT A BIT BEFORE RESHOOTING
until script.Parent.HoldingMouse.Value == false > STOPS THE GUN WHEN THE PLAYER STOPPED HOLDING
end
end)
I hope this helped!
5 comments
rlly you copy pasted
I truly didn't I guess we just had the same idea.
ok but that third guy is REALLY copying
what lol
Umm.. I think US two had the same idea but really nobody copied your answer. There's just no reason to.