Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Attempt to index upvalue?

Asked by
Prioxis 673 Moderation Voter
9 years ago

I already searched up my issue and couldn't find a solution on both google, roblox wiki, or this site so bluetaslam do not lock this post

So I fixed one line of my code but it ended up showing an error in another line saying attempt to index upvalue 'bombspawn' (a nil value)

Line of code with the error

bb:MoveTo(bombspawn.BombLoc.Position)

whole block of code working with

local bombreload = false
local bombspawn = script.Parent.Parent.Parent.Parent:FindFirstChild("Design")
function bomb()
if bombreload == true then
    print'reloading bombs'
    else
local bb = game.ServerStorage.Bomb:Clone()
bb.Parent = game.Workspace
bb:MoveTo(bombspawn.BombLoc.Position)
bombreload = true
wait(15)
bombreload = false
    end
end
0
Then either name them differently or use a table and a for loop to get them all... I suggest not using FindFirstChild and use WaitForChild; that's not quite the situation for FFC anyways. unmiss 337 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Check to see if you have too many parents or not enough parents on line 2. bombspawn may be nil because it couldn't find "Design"

0
Well I can't locate the plane by doing game.Workspace.Planekit.Design because I will have multiple planes Prioxis 673 — 9y
Ad

Answer this question