i have a sword script and it will stop working and this will show up in the output 21:40:31.563 - Infinite yield possible on 'Workspace.:WaitForChild("Humanoid")' im not sure how to fix it but here is the script
local Obj = script.Parent local Debounce = true Obj.Touched:connect(function(Hit) if Debounce == true then Debounce = false wait() if Hit.Parent:findFirstChild("Humanoid") then Hit.Parent.Humanoid:TakeDamage(15) wait(1) Debounce = true end end end)
1 local Obj = script.Parent 02 03 local Debounce = true 04 05 Obj.Touched:connect(function(Hit) 06 if Debounce == true then 07 Debounce = false 08 wait() 09 if Hit.Parent:FindFirstChild("Humanoid") then 10 Hit.Parent.Humanoid.Health = Hit.Parent.Humanoid.Health -15 11 wait(1) 12 Debounce = true 13 end 14 end 15 end)
remove numbers