I am not sure how to interpret what the Output said(stated after code). I could be adding too many ends or something, or adding too few or whatever. If I knew I wouldn't be asking. The name of the script is 'L00t'
while wait(10) do
z = math.random(1,4)
print(z)
---------------------------------------------------------------------------------------------------
if z == 1 then
a = game.Lighting.ScrapCorrodeA:Clone()
a.Parent = game.Workspace
wait(5)
if a.Parent ~= game.Workspace then
Print("ScrapCorrodeA was picked up!")
else
a:Remove()
end
---------------------------------------------------------------------------------------------------
elseif z == 2 then
b = game.Lighting.PipeCorrodeA:Clone()
b.Parent = game.Workspace
wait(5)
if b.Parent ~= game.Workspace then
Print("PipeCorrodeA was picked up!")
else
b:Remove()
end
---------------------------------------------------------------------------------------------------
elseif z == 3 then
c = game.Lighting.FabricA:Clone()
c.Parent = game.Workspace
wait(5)
if c.Parent ~= game.Workspace then
Print("FabricA was picked up!")
else
c:Remove()
end
end
--------------------------------------------------------------------------------------------------
elseif z == 4 then --LINE 36
d = game.Lighting.SpringA:Clone()
d.Parent = game.Workspace
wait(5)
if d.Parent ~= game.Workspace then
Print("SpringA was picked up!")
else
d:Remove()
end
end
end
Here is what I got in Output just after testing: 20:26:11.356 - Workspace.L00t:36: 'end' expected (to close 'while' at line 1) near 'elseif'

3 comments
Missing 3 ends. (For all the else ifs)
You have an extra end in the third elseif (z == 3, extra on line 33 or 34.)
And I also realize that I duplicate a variable and refer to it later on.