Help with some stray code!

function Oregon_Trail() {
    Music = 1
    Weapon = 0
    scroller.setLayerImage(scroller.BackgroundLayer.Layer0, assets.image`Background Level`)
    tiles.setCurrentTilemap(tilemap`Oregon Trail`)
    mySprite = sprites.create(assets.image`Felix 13`, SpriteKind.Player)
    mySprite4 = sprites.create(assets.image`Jack 5`, SpriteKind.Jack_)
    mySprite2 = sprites.create(assets.image`Wagon 2`, SpriteKind.Wagon)
    scene.cameraFollowSprite(mySprite)
    tiles.placeOnTile(mySprite, tiles.getTileLocation(4, 7))
    tiles.placeOnTile(mySprite2, tiles.getTileLocation(3, 10))
    tiles.placeOnTile(mySprite4, tiles.getTileLocation(3, 7))
    color.startFadeFromCurrent(color.originalPalette, 1000)
    pause(1500)
    if (_1stScene1stTime == 0) {
        story.printCharacterText("Let's rest for now. I got the campfire lit.", "Felix")
        story.printCharacterText("Alright man. I'll rest in the wagon.", "Jack")
        story.printCharacterText("It's busted for now, but I got some supplies.", "Jack")
    }
    mySprite4.follow(mySprite2, 50)
    pause(1000)
    mySprite.setImage(assets.image`Felix 12`)
    pause(1000)
    Title2 = sprites.create(assets.image`CinemaBars 4`, SpriteKind.Nothing)
    Title2.setStayInScreen(true)
    tileUtil.centerCameraOnTile(tiles.getTileLocation(10, 3))
    pause(1000)
    mySprite3 = sprites.create(assets.image`Zombie 14`, SpriteKind.First_Kill)
    tiles.placeOnTile(mySprite3, tiles.getTileLocation(10, 3))
    animation.runImageAnimation(
        mySprite3,
        assets.animation`Slow Zombie Spawn`,
        200,
        false
    )
    pause(1600)
    Zombie_Look()
    pause(1000)
    story.printCharacterText("Brrr!!", "Zombie")
    scene.cameraFollowSprite(mySprite)
    sprites.destroy(Title2)
    Title2 = sprites.create(assets.image`CinemaBars 3`, SpriteKind.Nothing)
    Title2.setStayInScreen(true)
    pause(500)
    if (_1stScene1stTime == 0) {
        story.printCharacterText("Jesus Christ!", "Felix")
        story.printCharacterText("Jack, there is a zombie!!", "Felix")
        animation.runImageAnimation(
            Title2,
            assets.animation`Action Time 2`,
            400,
            false
        )
        story.printCharacterText("Don't you remember how to defend yourself?", "Jack")
        pause(1000)
        sprites.destroy(Title2)
        mySprite8 = sprites.create(assets.image`WASD Tutorial`, SpriteKind.Nothing)
        animation.runImageAnimation(
            mySprite8,
            assets.animation`WASD Tutorial`,
            200,
            true
        )
        mySprite8.x = mySprite.x
        mySprite8.y = mySprite.y
        mySprite8.z = 1e+31
        Notification.notify("WASD to move around!", 4, assets.image`Movement Icon`)
        Moving = true
        sprites.destroy(mySprite8)
        controller.moveSprite(mySprite, 75, 75)
        pause(5000)
        statusbar = statusbars.create(60, 6, StatusBarKind.Health)
        statusbar.setColor(2, 15)
        statusbar.positionDirection(CollisionDirection.Top)
        statusbar2 = statusbars.create(60, 6, StatusBarKind.None)
        statusbar2.positionDirection(CollisionDirection.Bottom)
        statusbar2.setColor(12, 15)
        Ammo = 6
        controller.moveSprite(mySprite, 0, 0)
        mySprite8 = sprites.create(assets.image`JKIL Tutorial`, SpriteKind.Nothing)
        animation.runImageAnimation(
            mySprite8,
            assets.animation`JKIL Tutorial`,
            200,
            true
        )
        mySprite8.x = mySprite.x
        mySprite8.y = mySprite.y
        mySprite8.z = 1e+31
        Notification.notify("JKIL to shoot zombies!", 4, assets.image`Gun Icon`)
        controller.moveSprite(mySprite, 75, 75)
        sprites.destroy(mySprite8)
        Shooting = true
    } else {
        animation.runImageAnimation(
            Title2,
            assets.animation`Action Time 2`,
            400,
            false
        )
        pause(3000)
        statusbar = statusbars.create(60, 6, StatusBarKind.Health)
        statusbar.setColor(2, 15)
        statusbar.positionDirection(CollisionDirection.Top)
        statusbar2 = statusbars.create(60, 6, StatusBarKind.None)
        statusbar2.positionDirection(CollisionDirection.Bottom)
        statusbar2.setColor(12, 15)
        Ammo = 6
        sprites.destroy(Title2)
        controller.moveSprite(mySprite, 75, 75)
        Moving = true
        Shooting = true
        }
    }
}

here is the problem; I don’t use Javascript, so when encountering this issue, I couldn’t resolve it. The problem is that the last line requires a “declaration” of some sort. If you could help, I would very much appreciate it.

We might need to see the rest of the project to figure out what’s happening. Would you mind posting a link to the game?

1 Like

other then the fact that there is no variable declaration and i don’t have all the extensions, the problem i had first was there’s an } extra at the end so just removes that and it might work.
but like KIKIvsIT said having the whole project would help pin point the error