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

Why does this stop?

Everything here works, except anything past line 14 wont run, why?

JumpValu = 50


function update()
	print("upd8")
	JumpValu = 50
	for i=1,8 do
	local StickerValue = stickers["Sticker"..i].Value
	if StickerValue~="" and StickerValue~="LOCKED" then
		if game.ServerStorage.assets.stickers:WaitForChild(StickerValue):FindFirstChild("Jump") then
			JumpValu = JumpValu + game.ServerStorage.assets.stickers:WaitForChild(StickerValue):FindFirstChild("Jump").Value
		end
	end
	end
	print("lol")
end

2 answers

✓ Accepted answer

When you call WaitForChild, you're checking for the sticker value instead of the sticker. Just change it to check for the sticker you're searching for.

The code you posted might not be sufficient to find a solution. I don't know what you're storing in the table, or how they might be indexed, so that might also be a problem. Let me know if this code doesn't work.

function update()
    print("upd8")
    JumpValu = 50
    for i=1,8 do
    local sticker = stickers["Sticker"..i]
    local StickerValue = sticker.Value
    if StickerValue~="" and StickerValue~="LOCKED" then
        if game.ServerStorage.assets.stickers:WaitForChild(sticker):FindFirstChild("Jump") then
            JumpValu = JumpValu + game.ServerStorage.assets.stickers:WaitForChild(sticker):FindFirstChild("Jump").Value
        end
    end
    end
    print("lol")
end

update()


You did not call the function. Do this:

JumpValu = 50

function update()
    print("upd8")
    JumpValu = 50
    for i=1,8 do
    local StickerValue = stickers["Sticker"..i].Value
    if StickerValue~="" and StickerValue~="LOCKED" then
        if game.ServerStorage.assets.stickers:WaitForChild(StickerValue):FindFirstChild("Jump") then
            JumpValu = JumpValu + game.ServerStorage.assets.stickers:WaitForChild(StickerValue):FindFirstChild("Jump").Value
        end
    end
    end
    print("lol")
end

update()

1 comment

0

No that's not the issue. I do call the function, I just didn't list it here. The problem is that on line 15 nothing happens

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