@davy1222 your code is so wasteful… You really need to invest some time to understand arrays of objects. It will make your code far more simple and readable.
For example, this code
local function move(event) bg2.x = bg2.x - scrollSpeed/2 bg3.x = bg3.x - scrollSpeed/2 bg4.x = bg4.x - scrollSpeed/2 bg5.x = bg5.x - scrollSpeed/2 bg6.x = bg6.x - scrollSpeed/2 bg7.x = bg7.x - scrollSpeed bg8.x = bg8.x - scrollSpeed bg9.x = bg9.x - scrollSpeed bg10.x = bg10.x - scrollSpeed bg11.x = bg11.x - scrollSpeed if(-bg2.x + bg2.contentWidth) \> 1080 then bg2:translate(2000,0) end if(-bg3.x + bg3.contentWidth) \> 1080 then bg3:translate(2000,0) end if(-bg4.x + bg4.contentWidth) \> 1080 then bg4:translate(2000,0) end if(-bg5.x + bg5.contentWidth) \> 1080 then bg5:translate(2000,0) end if(-bg6.x + bg6.contentWidth) \> 1080 then bg6:translate(2000,0) end if(-bg7.x + bg7.contentWidth) \> 1080 then bg7:translate(2000,0) end if(-bg8.x + bg8.contentWidth) \> 1080 then bg8:translate(2000,0) end if(-bg9.x + bg9.contentWidth) \> 1080 then bg9:translate(2000,0) end if(-bg10.x + bg10.contentWidth) \> 1080 then bg10:translate(2000,0) end if(-bg11.x + bg11.contentWidth) \> 1080 then bg11:translate(2000,0) end end
could be simplified to
local function move(event) for i = 1, 11 do if i \< 7 then gb[i].x = gb[i].x - scrollSpeed/2 else gb[i].x = gb[i].x - scrollSpeed end if(-bg[i].x + bg[i].contentWidth) \> 1080 then bg[i]:translate(2000,0) end end end