i keep getting this message on this script im working on. I'm still pretty new to scripting so im not sure exactly how to fix this.
function Drop()
local drops = {"NUKE"}
local G = math.random(1, 150)
local Obj = game.Lighting:findFirstChild(drops[G]):Clone()
Obj.Parent = game.Workspace
Obj.Handle.CFrame = script.Parent.Head.CFrame + Vector3.new(4,-3,0)
script:remove()
end
while true do
wait(.1)
if (script.Parent.Humanoid.Health <1) then
Drop()
end
end
basically i want it so if the math.random number lands on "1" then the nuke will spawn, and if it lands on 2-150, then nothing will spawn.
now the item does spawn in, but i keep getting this error code in output and i'd like to clean up everything i can

3 comments
i tried this but got the error code " : Expected ')' (to close '(' at line 6), got 'end' "
ok i may have explained this poorly, what i want to happen is in the math.random i want it so if the number lands on "1" then the nuke will drop. any if it lands on any numbers between 2 - 150 then nothing will happen
Ah, let me fix this accordingly.