Hi. I’m trying to make a hover tool here.
The issue is that there is no time limit on it at all so you can just use it forever which would be too overpowered.
So how would I make it so you can only use this tool for 5 seconds then it unequips and you can’t use it for another 5 seconds?
I don’t know how to make this anymore clear other than this but basically when you equip the tool 5 seconds after equipping it, it unequips itself and then you can’t equip the tool for 5 seconds.
Looking up the issue on google and even here on the devhub didn’t give me any results sadly which is why I’m asking here.
Here’s the script I’m using:
Can you please explain what you are trying to make the tool do (besides 5 seconds cooldown)? I think you used scripts from a tool giver model incorrectly (just found a tool giver with the exact same script)
The tool just makes you hover in the air and you’re able to move freely with it.
Nothing extra at all and the tool is in the StarterPack as you can see on the screenshot.
There aren’t any tool givers or anything.
You could create a variable, set it to false, name it ‘cooldown’. Before running your code after the player clicks, you can write if cooldown == false then and set cooldown to true if it is false. After your code runs, (whatever it is) place a wait(5) at the end, then set cooldown to false again.
local cooldown =false
Clicked:Connect(function() -- Make sure to edit this event
if cooldown == false then
-- write code
wait(5) -- If your code takes time, make sure to subtract from that
I tried both, and I’m actually so confused. I have no idea how to apply these two to this script since the script I’m using already has a local debounce and it basically clashes with the one in the replies. I’ll update if I find a solution