Sorry for the vague question title.
Here is my script.. it works most of the time, but sometimes it will give an error saying that "lavawalk2 isn't a valid member of Workspace," and sometimes it won't remove the models, just recreate over them.
I'm not sure why, as far as my scripting goes, nothing looks wrong.
math.randomseed(tick())
while true do
print("now cloning in obbies")
print(" ")
num = math.random(2)
if num == 1 then
game.Lighting.lavajump:Clone().Parent = workspace elseif
num == 2 then
game.Lighting.lavawalk:Clone().Parent = workspace
end
num2 = math.random(2)
if num2 == 1 then
game.Lighting.lavajump2:Clone().Parent = workspace elseif
num == 2 then
game.Lighting.lavawalk2:Clone().Parent = workspace
end
print("the first obby is".." "..num)
print("the second obby is".." "..num2)
wait(4)
print("now removing obbies")
print(" ")
wait(1)
if num == 1 then
game.Workspace.lavajump:Remove() elseif
num == 2 then
game.Workspace.lavawalk:Remove()
end
if num2 == 1 then
game.Workspace.lavajump2:Remove() elseif
num2 == 2 then
game.Workspace.lavawalk2:Remove()
wait(2)
end
end

3 comments
which line did the error start to occur? (it should be stated in the output)
Try using game.Workspace:WaitForChild("lavawalk2"):Remove() The script is probably running before the lavawalk2 had been created in Workspace
^ Almost certainly.