Hello develupers I don not know to how disable all funcions of a tool here the script of my tool , I want to make the tool disable for 20 seconds after activating it
You know wath funcion do I use? enabled?.Tank you
Hello develupers I don not know to how disable all funcions of a tool here the script of my tool , I want to make the tool disable for 20 seconds after activating it
Add a debounce by disabling you mean a cooldown?
Here’s what it would look like
local Debounce = false
script.Parent.Activated:Connect(function()
if Debounce then return end
Debounce = true
task.delay(20,function() debounce = false end)
my example isn’t how its normally done but you can just add this for your desired outcome*
I say disable all tool funcions so I can not use it for 20 seconds
What I show you would act as a Cooldown but are you saying that you want to disable the unequip function as well?
You would still use a debounce.
Or are you referring to the example I sent? Do you need me to type out the solution applied? If so I am sorry but I must refuse.
Oh I Just need a funcion that disable a funcions for 20 seconds
Exenple: if you active this tool it s make a drink animation and change you walk speed, and I want to after this, disable all this funcions for 20 seconds until can use it again.
To disable a function you would disconnect it but first it would need to be defined so you can call on it.
local FunctionConnection = script.Parent.Activated:Connect(function() end)
FunctionConnection:Disconnect()
But doing that would remove it and you would need to reconnect the function back. That is just more difficult when you can just use a debounce to disable it momentarily.
Yea realy is very hard I will make a debounce do TANKS for the help:)