im trying to spawn a block (with an other script) and delte it again with this script and it just keeps putting out error codes like the one in the titel
local Debris = game:GetService("Debris")
local nta = "nothing got added yet"
function lte2brickdestroy()
workspace.lte1buttonscript.ChildAdded:Connect(function(instance)
instance.Name = nta
if nta == "lte2brick" then
Debris:AddItem()
end
end)
end
game.Workspace.lead_to_exit1_button.ClickDetector.MouseClick:lte2brickdestroy()

6 comments
click view source, the last right bracket is missing for some reason
REMEMBER CLICK VIEW SOURCEE
HOVER YOUR MOUSE TO THE LAST SCRIPT AND CLICK VIEW SOURCE
caps so you can see the comments
thanks now the error is gone
remember to accept the answer if it solves you question