Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Attempt to index upvalue?

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

1 comment

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.

1 answer

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"

1 comment

0

Well I can't locate the plane by doing game.Workspace.Planekit.Design because I will have multiple planes

This discussion is preserved as it was. New answers, comments, and votes are closed.