Hello fellow deform users! For an unknown reason my simple ability script refuses to work properly, and I want it to work properly, if you somehow haven’t already noticed. The problem with the script is that it has no cooldown, yes I have tried debugging it but I have found no solution so far.
here is the server script.
local plrs = game:GetService("Players")
local plr = plrs:GetPlayers()[1] or plrs.PlayerAdded:Wait()
local tool1 = script.Parent
tool1.Equipped:Connect(function()
local db = false
local Drinkanim = plr.Character:WaitForChild("Humanoid"):LoadAnimation(tool1.DrinkAnim)
if db == true then
tool1.Parent = plr.Backpack
return
end
if db == false then
db = true
Drinkanim:Play()
task.delay(.9, function()
tool1.DrinkSound:Play()
end)
tool1.Parent.Humanoid.WalkSpeed = 5
task.wait(1.2)
tool1.Parent.Humanoid.WalkSpeed = 35
tool1.Parent = plr.Backpack
tool1.Handle.Transparency = 1
task.wait(5)
plr.Character.Humanoid.WalkSpeed = 25
task.wait(15)
tool1.Handle.Transparency = 0
db = false
end
end)
All help is appreciated!