sooo im trying to make a tool switching cooldown like after you equip a tool u cant unequip it for 1 second and once that second is done u can unequip it. this is all i have and it doesnt work at all
local tool: Tool = script.Parent
local backpack = tool.Parent
local otheparent -- Whenever equipped this is set
local cooldowntime = 1 -- I assume you want this number
local ison = false
local cooldown = false
local quickcool = false -- so the whole thing doesn't call itself billions of times
tool:GetPropertyChangedSignal("Parent"):Connect(function ()
if not quickcool then
if not cooldown then
if tool.Parent == backpack then
ison = false
else
ison = true
otheparent = tool.Parent
end
cooldown = true
wait(cooldowntime)
cooldown = false
else
if ison then
tool.Parent = otheparent
else
tool.Parent = backpack
end
end
wait()
end
end)