I just need help because whenever I try creating a cooldown, you can still spam the invisibility power.
game.Players.LocalPlayer:GetMouse().KeyDown:Connect(function(key)
if key == "e" then
local TS = game:GetService("TweenService")
local Info = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
for _, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("BasePart") and v.Name~= "HumanoidRootPart" then
TS:Create(v, Info, {Transparency=1}):Play()
end
end
wait(20)
local TS = game:GetService("TweenService")
local Info = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.Out)
for _, v in pairs(script.Parent:GetDescendants()) do
if v:IsA("BasePart") and v.Name~= "HumanoidRootPart" then
TS:Create(v, Info, {Transparency=0}):Play()
end
end
--
end
end)
