In this sword script I made, I added an animation, but when I press f9 to activate the dev console, it says
Infinite yield possible on 'Workspace:WaitForChild("Humanoid")'
any way to fix this?
--//Variables
local tool = script.Parent.Parent
local handle = tool:WaitForChild("Handle")
local blade = tool:WaitForChild("Blade")
local config = tool:WaitForChild("Configuration")
local dmg = config:WaitForChild("Damage")
local cooldown = config:WaitForChild("CoolDown")
local ani = tool:WaitForChild("Animation")
tool.Equipped:connect(function(mouse)
local Humanoid = tool.Parent:WaitForChild("Humanoid")
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/Asset?ID=970463218"
tool.Activated:connect(function()
blade.Damage.Disabled = false
local animTrack = Humanoid:LoadAnimation(animation)
animTrack:Play()
wait(cooldown.Value)
blade.Damage.Disabled = true
end)
end)
