Hi, some scripts like the knife tool can be charged? How do they do it? I don't recommend to use Button1Down
.
I believe you require tick for this problem. For example, if you want to print the amount of time a user has held down the tool for, you can record the tick when they player activates the tool and get the difference in tick when the user releases it. For example, if this was in a script inside the tool:
local Tool = script.Parent local LastTick = 0 --When the player starts clicking: Tool.Activated:Connect(function() LastTick = tick() end) --When the player stops clicking: Tool.Deactivated:Connect(function() local ChargeTime = tick() - LastTick print("The tool has been charged for " .. ChargeTime) end)
tick()
returns a number that constantly increments, increasing by 1 every second & accurate to many decimal places, so when you get the difference in tick from when the tool was first activated to when it is deactivated, you get the amount of time the tool was activated for.