I have a function inside of my script and some part of a function is unreachable. I don’t know why and I don’t get any warnings or errors.
local start = coroutine.wrap(function() while active == true do for index, Object in pairs (workspace:GetDescendants()) do if Object.Name == 'Humanoid' then local mag = (script.Parent.TouchBrick.Position-Object.Parent.HumanoidRootPart.Position).magnitude print(mag, script.Parent:GetFullName()) -- Unreachable if mag <= script.Parent.Range.Value then Object:TakeDamage(20) end end end wait() end end)
This is supposed to kill anyone close to the script’s parent. I added a print statement to get what was wrong, and it’s just printing nothing. What’s wrong?