Attempt to compare nil with number?

I go into my game file and it gets an error saying (Attempt to compare nil with number)

whats wrong with it?

        local function scrolltile(self,event)

            if self.x < -320 then

                self.x = 320

            else

                self.x = self.x - self.speed

            end

        end    

        

        tileback.enterFrame = scrolltile

        Runtime:addEventListener(“enterFrame”, tileback)

        

        tileback1.enterFrame = scrolltile

        Runtime:addEventListener(“enterFrame”, tileback1)

        

        Runtime:addEventListener(“collision”, onCollision)

        

        Runtime:addEventListener(“touch”, touchScreen)

        

        group:insert(topBlock)

        group:insert(bottomBlock)

        group:insert(tileback)

        group:insert(tileback1)

        group:insert(robin)

        group:insert(ok)

        

end

scratch the groups and collision and touch listeners

Maybe self is nil?

what?

it should have given you a line number where that was happening.  It would be super helpful to know that and what line it’s complaining about.

Guessing the self function parameter has a nil value, but can’t say for sure without the line number the error reports.

scratch the groups and collision and touch listeners

Maybe self is nil?

what?

it should have given you a line number where that was happening.  It would be super helpful to know that and what line it’s complaining about.

Guessing the self function parameter has a nil value, but can’t say for sure without the line number the error reports.