Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Forest Fire Dancing Issues


I’m trying to beat the Forest Fire Dancing level (level 13 of Backwoods Forest if you include the arena). With just the starting code, it says for line 2 (just “loop”): “ReferenceError: pos is not defined”

This is the code without anything added (which brings up the error regardless):

    local evilstone = self:findNearest(self:findItems())
    if evilstone then
        pos = evilstone.pos
        if pos.x == 34 then
            -- If the evilstone is on the left, go to the right side.
            -- If the evilstone is on the right, go to the left side.
        -- If there's no evilstone, go to the middle.

How would I be able to get this to go away? Tharin doesn’t do anything because of this. Thanks.


Everything in Lua needs to be scoped.

Add local in front of pos.


This error is gone, but now on line three it says:

“TypeError: Can’t read protected property: findNearestItem”

so there’s that


You need to upgrade/downgrade your glasses.

If your glasses are too ‘good’, you need to use self:findNearest(self:findItems())

If your glasses aren’t good enough, you won’t have self:findNearestItem() or self:findNearest() or self:findItems()