I need this loop to work so that he drops the block multiple times but it doesnt loop and says "attempt to call a nil value" pls help
function bloc()
local count = 1000
while count == 1000 do
local gb = script.Parent.Health
local mp = game.Lighting.money
if gb <= 29999 then
wait(2)
mp:Clone()
mp.Parent = game.Workspace
mp.Position = script.Parent.Parent.HumanoidRootPart.Position
end
end
script.Parent.HealthChanged:Connect(bloc)
end

1 comment
the error is that in output it says attempt to call a nil value and the script isnt looping