Platformer Race v1.1 [DISCONTINUED]
@Stage\n\nwhen flag clicked\nset [already-stopped? v] to [0]\nforever\n    play sound [Masked Heroes v] until done\nend\n\nwhen I receive [stop-music v]\nstop [other scripts in sprite v]\nset [already-stopped? v] to [1]\n\nwhen I receive [start-race v]\nif <(already-stopped?) = [1]> then\n    stop [other scripts in sprite v]\n    stop all sounds\n    set [already-stopped? v] to [0]\n    forever\n        play sound [Masked Heroes v] until done\n    end\nend\n\n@Player\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset size to (75) %\nclear graphic effects\nswitch costume to (player v)\nset [zoom v] to [100]\nset [playerx v] to [-814]\nset [playery v] to [-391]\nset [xv v] to [0]\nset [yv v] to [0]\nset [scrollx v] to (playerX)\nset [scrolly v] to (playerY)\nset [cam-force v] to [0.1]\nset [visible? v] to [1]\nset [level v] to [1]\nset [pid v] to [0]\nset [frames-per-second v] to []\nrepeat (8)\n    change [pid v] by (1)\n    create clone of (_myself_ v)\nend\nset [pid v] to [0]\nset [oldt v] to (((days since 2000) * (86400)) - (0.01))\nforever\n    set [frames-per-second v] to ((1) / (((days since 2000) * (86400)) - (oldt)))\n    set [oldt v] to ((days since 2000) * (86400))\n    if <(fps-based?) = [1]> then\n        if <(frames-per-second) > [23]> then\n            skip [1] frames\n        else\n            if <(frames-per-second) > [15]> then\n                skip [2] frames\n            else\n                skip [3] frames\n            end\n        end\n    else\n        skip [1] frames\n    end\n    if <(playerY) < [-1000]> then\n        start sound [Oops v]\n        set [playerx v] to [-814]\n        set [playery v] to [-391]\n        repeat until <<(visible?) = [1]> and <(cam-dist) < [50]>>\n            Move camera <>\n            go to x: (playerX) y: (playerY) \n        end\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <(die?) = [1]> then\n        start sound [Glass Breaking v]\n        start sound [Oops v]\n        switch costume to (player v)\n        repeat (8)\n            next costume\n            Move camera <>\n            go to x: (playerX) y: (playerY) \n        end\n        repeat (20)\n            change [ghost v] effect by (5)\n            Move camera <>\n            go to x: (playerX) y: (playerY) \n        end\n        set [ghost v] effect to (100)\n        switch costume to (player v)\n        set [playerx v] to [-813]\n        set [playery v] to [-391]\n        repeat until <<(visible?) = [1]> and <(cam-dist) < [50]>>\n            Move camera <>\n            go to x: (playerX) y: (playerY) \n            clear graphic effects\n        end\n        set [xv v] to [0]\n        set [yv v] to [0]\n        clear graphic effects\n    end\n    if <(win?) = [1]> then\n        start sound [LevelPass v]\n        change [level v] by (1)\n        set [playerx v] to [-813]\n        set [playery v] to [-391]\n        repeat until <<(visible?) = [1]> and <(cam-dist) < [50]>>\n            Move camera <>\n            go to x: (playerX) y: (playerY) \n            clear graphic effects\n        end\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <key (r v) pressed?> then\n        set [playerx v] to [-813]\n        set [playery v] to [-391]\n        repeat until <<(visible?) = [1]> and <(cam-dist) < [50]>>\n            Move camera <>\n            go to x: (playerX) y: (playerY) \n            clear graphic effects\n        end\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <(teleport?) = [1]> then\n        start sound [Teleport2 v]\n        if <(Level) = [4]> then\n            set [playerx v] to [917]\n            set [playery v] to [350]\n        else\n            if <(Level) = [5]> then\n                set [playerx v] to [-810]\n                set [playery v] to [800]\n            else\n                if <(Level) = [6]> then\n                    set [playerx v] to [-730]\n                    set [playery v] to [800]\n                end\n            end\n        end\n        repeat until <<(visible?) = [1]> and <(cam-dist) < [50]>>\n            Move camera <>\n            go to x: (playerX) y: (playerY) \n            clear graphic effects\n        end\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    go to [front v] layer\nend\n\ndefine Platformer script\nset [die? v] to [0]\nset [win? v] to [0]\nset [teleport? v] to [0]\nApply force\nMove player\ngo to x: (playerX) y: (playerY) \nchange y by ((-10) * ((Zoom) / (100)))\ncheck colors\nchange y by ((10) * ((Zoom) / (100)))\ncheck colors\nif <(playerX) < [-961]> then\n    set [playerx v] to [-961]\n    set [xv v] to [0]\nend\nif <(playerX) > [961]> then\n    set [playerx v] to [961]\n    set [xv v] to [0]\nend\n\ndefine Apply force\nchange [yv v] by (-1)\nif <key (right arrow v) pressed?> then\n    change [xv v] by (1)\nend\nif <key (left arrow v) pressed?> then\n    change [xv v] by (-1)\nend\nset [xv v] to ((xv) * (0.9))\nset [yv v] to ((yv) * (0.99))\n\ndefine Move player\nMove camera <>\nchange x by ((xv) * ((Zoom) / (100)))\nchange y by ((yv) * ((Zoom) / (100)))\nif <touching color (#a4b9d7)?> then\n    change [playerx v] by (xv)\n    change [playery v] by (yv)\nelse\n    if <(visible?) = [1]> then\n        set [touching-x? v] to [0]\n        set [touching-y? v] to [0]\n        go to x: (playerX) y: (playerY) \n        check colors\n        change x by (((xv) + ((((cam-dist) * (cam-force)) * ([sin v] of (dir-to-player) )) - (1))) * ((Zoom) / (100)))\n        if <<touching (ground v)?> and <not <touching color (#a4b9d7)?>>> then\n            set [touching-x? v] to [1]\n            check colors\n        end\n        go to x: (playerX) y: (playerY) \n        change x by ((3) * ((Zoom) / (100)))\n        check colors\n        change x by ((-6) * ((Zoom) / (100)))\n        check colors\n        change x by ((3) * ((Zoom) / (100)))\n        change y by (((yv) + ((((cam-dist) * (cam-force)) * ([cos v] of (dir-to-player) )) - (1))) * ((Zoom) / (100)))\n        if <<touching (ground v)?> and <not <touching color (#a4b9d7)?>>> then\n            set [touching-y? v] to [1]\n            check colors\n        end\n        if <(touching-x?) = [1]> then\n            if <(xv) > [0]> then\n                change x by ((10) * ((Zoom) / (100)))\n            else\n                change x by ((-10) * ((Zoom) / (100)))\n            end\n            if <touching color (#a4b9d7)?> then\n                change [playerx v] by (xv)\n            else\n                if <key (up arrow v) pressed?> then\n                    start sound [Crunch v]\n                    set [yv v] to [15]\n                    change [playery v] by (1)\n                    if <(xv) > [0]> then\n                        set [xv v] to [-10]\n                    else\n                        set [xv v] to [10]\n                    end\n                else\n                    set [xv v] to [0]\n                end\n            end\n            go to x: (playerX) y: (playerY) \n        else\n            change [playerx v] by (xv)\n        end\n        if <(touching-y?) = [1]> then\n            set [touch? v] to [0]\n            change y by ((-5) * ((Zoom) / (100)))\n            check colors\n            if <touching color (#a4b9d7)?> then\n                set [touch? v] to [1]\n            end\n            change y by ((10) * ((Zoom) / (100)))\n            check colors\n            if <touching color (#a4b9d7)?> then\n                set [touch? v] to [1]\n            end\n            if <(touch?) = [0]> then\n                if <(yv) < [-20]> then\n                    start sound [Clang v]\n                end\n                if <<key (up arrow v) pressed?> and <not <(yv) > [0]>>> then\n                    start sound [Jump v]\n                    set [yv v] to [15]\n                else\n                    set [yv v] to [0]\n                end\n            end\n            change y by ((5) * ((Zoom) / (100)))\n        else\n            change [playery v] by (yv)\n        end\n    end\nend\ncheck colors\nfix\ncheck colors\n\ndefine go to x: (x) y: (y) <show?>\nset [olds v] to (size)\nhack size [300] %\ngo to x: (round (((x) - (scrollX)) * ((Zoom) / (100)))) y: (round (((y) - (scrollY)) * ((Zoom) / (100))))\nif <<<(x position) = (round (((x) - (scrollX)) * ((Zoom) / (100))))> and <(y position) = (round (((y) - (scrollY)) * ((Zoom) / (100))))>> and <show?>> then\n    show\n    set [visible? v] to [1]\nelse\n    hide\n    set [visible? v] to [0]\nend\nhack size (olds) %\n\ndefine hack size (size) %\nset [oldc v] to (costume [number v])\nif <(size) > [100]> then\n    switch costume to (dot v)\nelse\n    switch costume to (full v)\nend\nset size to (size) %\nswitch costume to (oldc)\n\ndefine Move camera <static?>\nif <static?> then\n    set [scrollx v] to (playerX)\n    set [scrolly v] to (playerY)\nelse\n    set [dir-to-player v] to ([atan v] of (((playerX) - (scrollX)) / ((playerY) - (scrollY))) )\n    if <((playerY) - (scrollY)) < [0]> then\n        change [dir-to-player v] by (180)\n    end\n    set [cam-dist v] to ([sqrt v] of ((((playerX) - (scrollX)) * ((playerX) - (scrollX))) + (((playerY) - (scrollY)) * ((playerY) - (scrollY)))) )\n    change [scrollx v] by (((cam-dist) * (cam-force)) * ([sin v] of (dir-to-player) ))\n    change [scrolly v] by (((cam-dist) * (cam-force)) * ([cos v] of (dir-to-player) ))\nend\nif <(scrollX) < [-740]> then\n    set [cam-dist v] to ([sqrt v] of ((((playerX) - ((scrollX) + (round ((playerX) - (scrollX))))) * ((playerX) - ((scrollX) + (round ((playerX) - (scrollX)))))) + (((playerY) - (scrollY)) * ((playerY) - (scrollY)))) )\n    set [scrollx v] to [-740]\nend\nif <(scrollX) > [740]> then\n    set [scrollx v] to [740]\n    set [cam-dist v] to ([sqrt v] of ((((playerX) - ((scrollX) + (round ((playerX) - (scrollX))))) * ((playerX) - ((scrollX) + (round ((playerX) - (scrollX)))))) + (((playerY) - (scrollY)) * ((playerY) - (scrollY)))) )\nend\n\ndefine check colors\nif <touching color (#ff0000)?> then\n    set [die? v] to [1]\nend\nif <touching color (#00ff2e)?> then\n    set [win? v] to [1]\nend\nif <touching color (#faff00)?> then\n    start sound [Big Boing v]\n    set [yv v] to [40]\n    change [playery v] by (-2)\nend\nif <touching color (#7a00ff)?> then\n    set [teleport? v] to [1]\nend\n\ndefine fix\ngo to x: (playerX) y: (playerY) \nif <<<touching (ground v)?> and <not <touching color (#a4b9d7)?>>> and <(visible?) = [1]>> then\n    change x by ((10) * ((Zoom) / (100)))\n    if <touching (ground v)?> then\n        change x by ((-10) * ((Zoom) / (100)))\n        change y by ((10) * ((Zoom) / (100)))\n        if <touching (ground v)?> then\n            change y by ((-10) * ((Zoom) / (100)))\n            change x by ((-10) * ((Zoom) / (100)))\n            if <touching (ground v)?> then\n                change x by ((10) * ((Zoom) / (100)))\n                change y by ((-10) * ((Zoom) / (100)))\n                if <touching (ground v)?> then\n                    change y by ((10) * ((Zoom) / (100)))\n                    change x by ((7.07) * ((Zoom) / (100)))\n                    change y by ((7.07) * ((Zoom) / (100)))\n                    if <touching (ground v)?> then\n                        change x by ((-7.07) * ((Zoom) / (100)))\n                        change y by ((-7.07) * ((Zoom) / (100)))\n                        change x by ((-7.07) * ((Zoom) / (100)))\n                        change y by ((-7.07) * ((Zoom) / (100)))\n                        if <touching (ground v)?> then\n                            change x by ((7.07) * ((Zoom) / (100)))\n                            change y by ((7.07) * ((Zoom) / (100)))\n                            change x by ((-7.07) * ((Zoom) / (100)))\n                            change y by ((7.07) * ((Zoom) / (100)))\n                            if <touching (ground v)?> then\n                                change x by ((7.07) * ((Zoom) / (100)))\n                                change y by ((-7.07) * ((Zoom) / (100)))\n                                change x by ((7.07) * ((Zoom) / (100)))\n                                change y by ((-7.07) * ((Zoom) / (100)))\n                                if <touching (ground v)?> then\n                                    set [die? v] to [1]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\ngo to x: (playerX) y: (playerY) \n\nwhen I start as a clone\nhide\nforever\n    if <(pID) = (ID)> then\n        delete this clone\n    end\n    get data of player (pID)\n    go to x: (item (1) of [data v]) y: (item (2) of [data v]) <<(item (5) of [data v]) = [1]> and <(Level) = (item (7) of [data v])>>\n    think (item (4) of [data v])\n    if <(item (6) of [data v]) = [1]> then\n        switch costume to (player v)\n        repeat (8)\n            next costume\n            go to x: (item (1) of [data v]) y: (item (2) of [data v]) <<(item (5) of [data v]) = [1]> and <(Level) = (item (7) of [data v])>>\n        end\n        repeat (20)\n            change [ghost v] effect by (5)\n            go to x: (item (1) of [data v]) y: (item (2) of [data v]) <<(item (5) of [data v]) = [1]> and <(Level) = (item (7) of [data v])>>\n        end\n        set [ghost v] effect to (100)\n        switch costume to (player v)\n        wait (0.5) seconds\n        go to x: (item (1) of [data v]) y: (item (2) of [data v]) <<(item (5) of [data v]) = [1]> and <(Level) = (item (7) of [data v])>>\n        clear graphic effects\n    end\nend\n\ndefine get data of player (id)\ndelete all of [data v]\nset [i v] to [0]\nif <(id) = [1]> then\n    repeat (length of [player1 v])\n        change [i v] by (1)\n        add (item (i) of [player1 v]) to [data v]\n    end\nelse\n    if <(id) = [2]> then\n        repeat (length of [player2 v])\n            change [i v] by (1)\n            add (item (i) of [player2 v]) to [data v]\n        end\n    else\n        if <(id) = [3]> then\n            repeat (length of [player3 v])\n                change [i v] by (1)\n                add (item (i) of [player3 v]) to [data v]\n            end\n        else\n            if <(id) = [4]> then\n                repeat (length of [player4 v])\n                    change [i v] by (1)\n                    add (item (i) of [player4 v]) to [data v]\n                end\n            else\n                if <(id) = [5]> then\n                    repeat (length of [player5 v])\n                        change [i v] by (1)\n                        add (item (i) of [player5 v]) to [data v]\n                    end\n                else\n                    if <(id) = [6]> then\n                        repeat (length of [player6 v])\n                            change [i v] by (1)\n                            add (item (i) of [player6 v]) to [data v]\n                        end\n                    else\n                        if <(id) = [7]> then\n                            repeat (length of [player7 v])\n                                change [i v] by (1)\n                                add (item (i) of [player7 v]) to [data v]\n                            end\n                        else\n                            if <(id) = [8]> then\n                                repeat (length of [player8 v])\n                                    change [i v] by (1)\n                                    add (item (i) of [player8 v]) to [data v]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine skip (frames) frames\nrepeat (frames)\n    hack size ((0.75) * (Zoom)) %\n    Platformer script\n    go to x: (playerX) y: (playerY) \nend\n\nwhen I receive [start-race v]\ngo to x: (0) y: (0)\nset size to (75) %\nclear graphic effects\nswitch costume to (player v)\nset [zoom v] to [100]\nset [playerx v] to [-814]\nset [playery v] to [-391]\nset [xv v] to [0]\nset [yv v] to [0]\nset [scrollx v] to (playerX)\nset [scrolly v] to (playerY)\nset [cam-force v] to [0.1]\nset [visible? v] to [1]\nset [level v] to [1]\n\nwhen I receive [spectate-race v]\nif <(pID) = [0]> then\n    stop [other scripts in sprite v]\n    hide\n    forever\n        get data of player (followID)\n        set [playerx v] to (item (1) of [data v])\n        set [playery v] to (item (2) of [data v])\n        set [level v] to (item (7) of [data v])\n        Move camera <>\n    end\nend\n\nwhen I receive [start lod v]\nwait (0.25) seconds\nforever\n    if <<(playerX) < ((([x v] of [lineofdeath v]) + (240)) - (((Level) - (1)) * (1920)))> and <not <(Level) > ([current_level v] of [lineofdeath v])>>> then\n        stop [other scripts in sprite v]\n        hide\n        start sound [Lose v]\n        wait (4) seconds\n        stop [all v]\n    end\nend\n\n@Ground\n\nwhen flag clicked\nshow\nforever\n    go to x: [0] y: [0] \n    switch costume to (Level)\n    if <<(old-level) = [8]> and <(Level) = [9]>> then\n        broadcast (stop-music v)\n        stop all sounds\n        start sound [Win v]\n    end\n    set [old-level v] to (Level)\nend\n\ndefine go to x: (x) y: (y) <show?>\nhack size ((Zoom) * (4)) %\ngo to x: (round (((x) - (scrollX)) * ((Zoom) / (100)))) y: (round (((y) - (scrollY)) * ((Zoom) / (100))))\nif <<<(x position) = (round (((x) - (scrollX)) * ((Zoom) / (100))))> and <(y position) = (round (((y) - (scrollY)) * ((Zoom) / (100))))>> and <show?>> then\n    show\nelse\n    hide\nend\n\ndefine hack size (size) %\nset [oldc v] to (costume [number v])\nif <(size) > [100]> then\n    switch costume to (dot v)\nelse\n    switch costume to (full v)\nend\nset size to (size) %\nswitch costume to (oldc)\n\nwhen I receive [start-race v]\nforever\n    if <(Level) = [9]> then\n        say (join [Congratulations! You placed ] (join ([costume name v] of [place v]) [.])) for (5) seconds\n        if <(ID) = (☁ Host)> then\n            wait until <<<<<<<<<(item (7) of [player1 v]) = [9]> or <(item (5) of [player1 v]) = [0]>> and <<(item (7) of [player2 v]) = [9]> or <(item (5) of [player2 v]) = [0]>>> and <<(item (7) of [player3 v]) = [9]> or <(item (5) of [player3 v]) = [0]>>> and <<(item (7) of [player4 v]) = [9]> or <(item (5) of [player4 v]) = [0]>>> and <<(item (7) of [player5 v]) = [9]> or <(item (5) of [player5 v]) = [0]>>> and <<(item (7) of [player6 v]) = [9]> or <(item (5) of [player6 v]) = [0]>>> and <<(item (7) of [player7 v]) = [9]> or <(item (5) of [player7 v]) = [0]>>> and <<(item (7) of [player8 v]) = [9]> or <(item (5) of [player8 v]) = [0]>>>\n            set [☁ starttime v] to [0]\n        end\n        stop [this script v]\n    end\nend\n\n@Multiplayer\n\nwhen flag clicked\nset [characters v] to [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~`!@#$%^&*\(\)-_=+\[\]{}/\|;:'",.<>? ]\nset [offline limit v] to [5000]\nhide variable [min. players v]\n--- [Connect]\nsay [Connecting...]\nconnect\nif <(length of [players v]) = [1]> then\n    say [Starting a new game.] for (2) seconds\nelse\n    if <(length of [players v]) = [8]> then\n        say [Game is full!] for (2) seconds\n        stop [all v]\n    else\n        say [Found an active game!] for (2) seconds\n    end\nend\nsay []\nbroadcast (start v)\n\ndefine encode (text)\nset [output v] to []\nset [counter v] to [0]\nrepeat (length of (text))\n    change [counter v] by (1)\n    set [counter2 v] to [0]\n    repeat until <<(letter (counter2) of (characters)) = (letter (counter) of (text))> or <(counter2) > (length of (characters))>>\n        change [counter2 v] by (1)\n    end\n    if <(counter2) < [53]> then\n        switch costume to (lowercase v)\n        switch costume to (letter (counter) of (text))\n        if <(costume [number v]) = [27]> then\n            change [counter2 v] by (26)\n        end\n    end\n    if <(length of (counter2)) = [1]> then\n        set [counter2 v] to (join [0] (counter2))\n    end\n    set [output v] to (join (output) (counter2))\nend\n\ndefine decode (number)\nset [output v] to []\nset [counter v] to [-1]\nrepeat ((length of (number)) / (2))\n    change [counter v] by (2)\n    set [output v] to (join (output) (letter (join (letter (counter) of (number)) (letter ((counter) + (1)) of (number))) of (characters)))\nend\n\ndefine save list on var\nset [var v] to []\nset [counter3 v] to [0]\nrepeat (length of [list v])\n    change [counter3 v] by (1)\n    encode (item (counter3) of [list v])\n    set [var v] to (join (join (var) (output)) [00])\nend\n\ndefine load (number) to list\ndelete all of [list v]\nset [current-number v] to []\nset [counter3 v] to [-1]\nrepeat ((length of (number)) / (2))\n    change [counter3 v] by (2)\n    if <(join (letter (counter3) of (number)) (letter ((counter3) + (1)) of (number))) = [00]> then\n        decode (current-number)\n        add (output) to [list v]\n        set [current-number v] to []\n    else\n        set [current-number v] to (join (current-number) (join (letter (counter3) of (number)) (letter ((counter3) + (1)) of (number))))\n    end\nend\n\ndefine connect\ndelete all of [players v]\nset [id v] to [0]\n--- [All players]\nset [i2 v] to [0]\nrepeat (8)\n    change [i2 v] by (1)\n    load player (i2)\n    get data of player (i2) <>\n    if <(item (5) of [data v]) = [1]> then\n        set [old-tick v] to (item (3) of [data v])\n        reset timer\n        repeat until <<not <(old-tick) = (item (3) of [data v])>> or <(timer) > ((Offline Limit) / (1000))>>\n            load player (i2)\n            get data of player (i2) <>\n        end\n        if <(timer) > ((Offline Limit) / (1000))> then\n            kick player (i2)\n        end\n    end\n    load player (i2)\n    get data of player (i2) <>\n    if <(item (5) of [data v]) = [1]> then\n        add (item (4) of [data v]) to [players v]\n    else\n        if <(ID) = [0]> then\n            set [id v] to (i2)\n            add (username) to [players v]\n        end\n    end\nend\n\ndefine --- (label)\n\ndefine save player (id)\ndelete all of [list v]\nset [i v] to [0]\nif <(id) = [1]> then\n    repeat (length of [player1 v])\n        change [i v] by (1)\n        add (item (i) of [player1 v]) to [list v]\n    end\n    save list on var\n    set [☁ p1 v] to (var)\nelse\n    if <(id) = [2]> then\n        repeat (length of [player2 v])\n            change [i v] by (1)\n            add (item (i) of [player2 v]) to [list v]\n        end\n        save list on var\n        set [☁ p2 v] to (var)\n    else\n        if <(id) = [3]> then\n            repeat (length of [player3 v])\n                change [i v] by (1)\n                add (item (i) of [player3 v]) to [list v]\n            end\n            save list on var\n            set [☁ p3 v] to (var)\n        else\n            if <(id) = [4]> then\n                repeat (length of [player4 v])\n                    change [i v] by (1)\n                    add (item (i) of [player4 v]) to [list v]\n                end\n                save list on var\n                set [☁ p4 v] to (var)\n            else\n                if <(id) = [5]> then\n                    repeat (length of [player5 v])\n                        change [i v] by (1)\n                        add (item (i) of [player5 v]) to [list v]\n                    end\n                    save list on var\n                    set [☁ p5 v] to (var)\n                else\n                    if <(id) = [6]> then\n                        repeat (length of [player6 v])\n                            change [i v] by (1)\n                            add (item (i) of [player6 v]) to [list v]\n                        end\n                        save list on var\n                        set [☁ p6 v] to (var)\n                    else\n                        if <(id) = [7]> then\n                            repeat (length of [player7 v])\n                                change [i v] by (1)\n                                add (item (i) of [player7 v]) to [list v]\n                            end\n                            save list on var\n                            set [☁ p7 v] to (var)\n                        else\n                            if <(id) = [8]> then\n                                repeat (length of [player8 v])\n                                    change [i v] by (1)\n                                    add (item (i) of [player8 v]) to [list v]\n                                end\n                                save list on var\n                                set [☁ p8 v] to (var)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine load player (id)\nset [i v] to [0]\nif <(id) = [1]> then\n    load (☁ p1) to list\n    delete all of [player1 v]\n    repeat (length of [list v])\n        change [i v] by (1)\n        add (item (i) of [list v]) to [player1 v]\n    end\nelse\n    if <(id) = [2]> then\n        load (☁ p2) to list\n        delete all of [player2 v]\n        repeat (length of [list v])\n            change [i v] by (1)\n            add (item (i) of [list v]) to [player2 v]\n        end\n    else\n        if <(id) = [3]> then\n            load (☁ p3) to list\n            delete all of [player3 v]\n            repeat (length of [list v])\n                change [i v] by (1)\n                add (item (i) of [list v]) to [player3 v]\n            end\n        else\n            if <(id) = [4]> then\n                load (☁ p4) to list\n                delete all of [player4 v]\n                repeat (length of [list v])\n                    change [i v] by (1)\n                    add (item (i) of [list v]) to [player4 v]\n                end\n            else\n                if <(id) = [5]> then\n                    load (☁ p5) to list\n                    delete all of [player5 v]\n                    repeat (length of [list v])\n                        change [i v] by (1)\n                        add (item (i) of [list v]) to [player5 v]\n                    end\n                else\n                    if <(id) = [6]> then\n                        load (☁ p6) to list\n                        delete all of [player6 v]\n                        repeat (length of [list v])\n                            change [i v] by (1)\n                            add (item (i) of [list v]) to [player6 v]\n                        end\n                    else\n                        if <(id) = [7]> then\n                            load (☁ p7) to list\n                            delete all of [player7 v]\n                            repeat (length of [list v])\n                                change [i v] by (1)\n                                add (item (i) of [list v]) to [player7 v]\n                            end\n                        else\n                            if <(id) = [8]> then\n                                load (☁ p8) to list\n                                delete all of [player8 v]\n                                repeat (length of [list v])\n                                    change [i v] by (1)\n                                    add (item (i) of [list v]) to [player8 v]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine get data of player (id) <data2?>\nif <data2?> then\n    delete all of [data2 v]\nelse\n    delete all of [data v]\nend\nset [i v] to [0]\nif <(id) = [1]> then\n    repeat (length of [player1 v])\n        change [i v] by (1)\n        if <data2?> then\n            add (item (i) of [player1 v]) to [data2 v]\n        else\n            add (item (i) of [player1 v]) to [data v]\n        end\n    end\nelse\n    if <(id) = [2]> then\n        repeat (length of [player2 v])\n            change [i v] by (1)\n            if <data2?> then\n                add (item (i) of [player2 v]) to [data2 v]\n            else\n                add (item (i) of [player2 v]) to [data v]\n            end\n        end\n    else\n        if <(id) = [3]> then\n            repeat (length of [player3 v])\n                change [i v] by (1)\n                if <data2?> then\n                    add (item (i) of [player3 v]) to [data2 v]\n                else\n                    add (item (i) of [player3 v]) to [data v]\n                end\n            end\n        else\n            if <(id) = [4]> then\n                repeat (length of [player4 v])\n                    change [i v] by (1)\n                    if <data2?> then\n                        add (item (i) of [player4 v]) to [data2 v]\n                    else\n                        add (item (i) of [player4 v]) to [data v]\n                    end\n                end\n            else\n                if <(id) = [5]> then\n                    repeat (length of [player5 v])\n                        change [i v] by (1)\n                        if <data2?> then\n                            add (item (i) of [player5 v]) to [data2 v]\n                        else\n                            add (item (i) of [player5 v]) to [data v]\n                        end\n                    end\n                else\n                    if <(id) = [6]> then\n                        repeat (length of [player6 v])\n                            change [i v] by (1)\n                            if <data2?> then\n                                add (item (i) of [player6 v]) to [data v]\n                            else\n                                add (item (i) of [player6 v]) to [data v]\n                            end\n                        end\n                    else\n                        if <(id) = [7]> then\n                            repeat (length of [player7 v])\n                                change [i v] by (1)\n                                if <data2?> then\n                                    add (item (i) of [player7 v]) to [data2 v]\n                                else\n                                    add (item (i) of [player7 v]) to [data v]\n                                end\n                            end\n                        else\n                            if <(id) = [8]> then\n                                repeat (length of [player8 v])\n                                    change [i v] by (1)\n                                    if <data2?> then\n                                        add (item (i) of [player8 v]) to [data2 v]\n                                    else\n                                        add (item (i) of [player8 v]) to [data v]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine kick player (id)\nif <(id) = [1]> then\n    delete all of [player1 v]\n    add [0] to [player1 v]\n    add [0] to [player1 v]\n    add [0] to [player1 v]\n    add [] to [player1 v]\n    add [0] to [player1 v]\n    add [0] to [player1 v]\n    add [0] to [player1 v]\n    add [] to [player1 v]\nelse\n    if <(id) = [2]> then\n        delete all of [player2 v]\n        add [0] to [player2 v]\n        add [0] to [player2 v]\n        add [0] to [player2 v]\n        add [] to [player2 v]\n        add [0] to [player2 v]\n        add [0] to [player2 v]\n        add [0] to [player2 v]\n        add [] to [player2 v]\n    else\n        if <(id) = [3]> then\n            delete all of [player3 v]\n            add [0] to [player3 v]\n            add [0] to [player3 v]\n            add [0] to [player3 v]\n            add [] to [player3 v]\n            add [0] to [player3 v]\n            add [0] to [player3 v]\n            add [0] to [player3 v]\n            add [] to [player3 v]\n        else\n            if <(id) = [4]> then\n                delete all of [player4 v]\n                add [0] to [player4 v]\n                add [0] to [player4 v]\n                add [0] to [player4 v]\n                add [] to [player4 v]\n                add [0] to [player4 v]\n                add [0] to [player4 v]\n                add [0] to [player4 v]\n                add [] to [player4 v]\n            else\n                if <(id) = [5]> then\n                    delete all of [player5 v]\n                    add [0] to [player5 v]\n                    add [0] to [player5 v]\n                    add [0] to [player5 v]\n                    add [] to [player5 v]\n                    add [0] to [player5 v]\n                    add [0] to [player5 v]\n                    add [0] to [player5 v]\n                    add [] to [player5 v]\n                else\n                    if <(id) = [6]> then\n                        delete all of [player6 v]\n                        add [0] to [player6 v]\n                        add [0] to [player6 v]\n                        add [0] to [player6 v]\n                        add [] to [player6 v]\n                        add [0] to [player6 v]\n                        add [0] to [player6 v]\n                        add [0] to [player6 v]\n                        add [] to [player6 v]\n                    else\n                        if <(id) = [7]> then\n                            delete all of [player7 v]\n                            add [0] to [player7 v]\n                            add [0] to [player7 v]\n                            add [0] to [player7 v]\n                            add [] to [player7 v]\n                            add [0] to [player7 v]\n                            add [0] to [player7 v]\n                            add [0] to [player7 v]\n                            add [] to [player7 v]\n                        else\n                            if <(id) = [8]> then\n                                delete all of [player8 v]\n                                add [0] to [player8 v]\n                                add [0] to [player8 v]\n                                add [0] to [player8 v]\n                                add [] to [player8 v]\n                                add [0] to [player8 v]\n                                add [0] to [player8 v]\n                                add [0] to [player8 v]\n                                add [] to [player8 v]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nsave player (id)\n\ndefine Send\nif <(ID) = [1]> then\n    replace item (1) of [player1 v] with (round (playerX))\n    replace item (2) of [player1 v] with (round (playerY))\n    replace item (3) of [player1 v] with (Tick)\n    replace item (4) of [player1 v] with (username)\n    replace item (5) of [player1 v] with [1]\n    replace item (6) of [player1 v] with ([die? v] of [player v])\n    replace item (7) of [player1 v] with (Level)\n    replace item (8) of [player1 v] with (@EndTime)\nelse\n    if <(ID) = [2]> then\n        replace item (1) of [player2 v] with (round (playerX))\n        replace item (2) of [player2 v] with (round (playerY))\n        replace item (3) of [player2 v] with (Tick)\n        replace item (4) of [player2 v] with (username)\n        replace item (5) of [player2 v] with [1]\n        replace item (6) of [player2 v] with ([die? v] of [player v])\n        replace item (7) of [player2 v] with (Level)\n        replace item (8) of [player2 v] with (@EndTime)\n    else\n        if <(ID) = [3]> then\n            replace item (1) of [player3 v] with (round (playerX))\n            replace item (2) of [player3 v] with (round (playerY))\n            replace item (3) of [player3 v] with (Tick)\n            replace item (4) of [player3 v] with (username)\n            replace item (5) of [player3 v] with [1]\n            replace item (6) of [player3 v] with ([die? v] of [player v])\n            replace item (7) of [player3 v] with (Level)\n            replace item (8) of [player3 v] with (@EndTime)\n        else\n            if <(ID) = [4]> then\n                replace item (1) of [player4 v] with (round (playerX))\n                replace item (2) of [player4 v] with (round (playerY))\n                replace item (3) of [player4 v] with (Tick)\n                replace item (4) of [player4 v] with (username)\n                replace item (5) of [player4 v] with [1]\n                replace item (6) of [player4 v] with ([die? v] of [player v])\n                replace item (7) of [player4 v] with (Level)\n                replace item (8) of [player4 v] with (@EndTime)\n            else\n                if <(ID) = [5]> then\n                    replace item (1) of [player5 v] with (round (playerX))\n                    replace item (2) of [player5 v] with (round (playerY))\n                    replace item (3) of [player5 v] with (Tick)\n                    replace item (4) of [player5 v] with (username)\n                    replace item (5) of [player5 v] with [1]\n                    replace item (6) of [player5 v] with ([die? v] of [player v])\n                    replace item (7) of [player5 v] with (Level)\n                    replace item (8) of [player5 v] with (@EndTime)\n                else\n                    if <(ID) = [6]> then\n                        replace item (1) of [player6 v] with (round (playerX))\n                        replace item (2) of [player6 v] with (round (playerY))\n                        replace item (3) of [player6 v] with (Tick)\n                        replace item (4) of [player6 v] with (username)\n                        replace item (5) of [player6 v] with [1]\n                        replace item (6) of [player6 v] with ([die? v] of [player v])\n                        replace item (7) of [player6 v] with (Level)\n                        replace item (8) of [player6 v] with (@EndTime)\n                    else\n                        if <(ID) = [7]> then\n                            replace item (1) of [player7 v] with (round (playerX))\n                            replace item (2) of [player7 v] with (round (playerY))\n                            replace item (3) of [player7 v] with (Tick)\n                            replace item (4) of [player7 v] with (username)\n                            replace item (5) of [player7 v] with [1]\n                            replace item (6) of [player7 v] with ([die? v] of [player v])\n                            replace item (7) of [player7 v] with (Level)\n                            replace item (8) of [player7 v] with (@EndTime)\n                        else\n                            if <(ID) = [8]> then\n                                replace item (1) of [player8 v] with (round (playerX))\n                                replace item (2) of [player8 v] with (round (playerY))\n                                replace item (3) of [player8 v] with (Tick)\n                                replace item (4) of [player8 v] with (username)\n                                replace item (5) of [player8 v] with [1]\n                                replace item (6) of [player8 v] with ([die? v] of [player v])\n                                replace item (7) of [player8 v] with (Level)\n                                replace item (8) of [player8 v] with (@EndTime)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nsave player (ID)\n\ndefine Update\nif <not <(ID) = [1]>> then\n    load player [1]\nend\nif <not <(ID) = [2]>> then\n    load player [2]\nend\nif <not <(ID) = [3]>> then\n    load player [3]\nend\nif <not <(ID) = [4]>> then\n    load player [4]\nend\nif <not <(ID) = [5]>> then\n    load player [5]\nend\nif <not <(ID) = [6]>> then\n    load player [6]\nend\nif <not <(ID) = [7]>> then\n    load player [7]\nend\nif <not <(ID) = [8]>> then\n    load player [8]\nend\n\nwhen I receive [start v]\n--- [Upload data]\nforever\n    Send\n    wait (0.1) seconds\n    load player (ID)\n    get data of player (ID) <>\n    if <<not <(item (4) of [data v]) = (username)>> and <not <(item (4) of [data v]) = []>>> then\n        say [Something went wrong. Reconnecting...]\n        set [update-pause v] to [1]\n        connect\n        set [reset? v] to [1]\n        set [update-pause v] to [0]\n    end\nend\n\nwhen I receive [start v]\n--- [Update other players]\nset [update-pause v] to [0]\nforever\n    if <(update-pause) = [0]> then\n        Update\n    end\n    update players list\nend\n\ndefine tick\nchange [tick v] by (1)\nif <(Tick) > [9]> then\n    set [tick v] to [0]\nend\n\nwhen I receive [start v]\n--- [Tick]\nforever\n    wait (0.5) seconds\n    tick\nend\n\ndefine check player (id)\nget data of player (id) \nif <(item (5) of [data2 v]) = [1]> then\n    set [old-tick v] to (item (3) of [data2 v])\n    set [oldt v] to ((days since 2000) * (86400))\n    get data of player (id) \n    repeat until <<not <(item (3) of [data2 v]) = (old-tick)>> or <(((days since 2000) * (86400)) - (oldt)) > ((Offline Limit) / (1000))>>\n        get data of player (id) \n    end\n    if <(timer) > ((Offline Limit) / (1000))> then\n        kick player (id)\n    end\nend\n\nwhen I receive [start v]\n--- [Kick script]\nforever\n    check player [1]\n    wait (1) seconds\n    check player [2]\n    wait (1) seconds\n    check player [3]\n    wait (1) seconds\n    check player [4]\n    wait (1) seconds\n    check player [5]\n    wait (1) seconds\n    check player [6]\n    wait (1) seconds\n    check player [7]\n    wait (1) seconds\n    check player [8]\n    wait (1) seconds\nend\n\ndefine reset cloud\nkick player [1]\nkick player [2]\nkick player [3]\nkick player [4]\nkick player [5]\nkick player [6]\nkick player [7]\nkick player [8]\n\ndefine update players list\ndelete all of [players v]\nset [i3 v] to [0]\nrepeat (8)\n    change [i3 v] by (1)\n    get data of player (i3) <>\n    if <(item (5) of [data v]) = [1]> then\n        add (item (4) of [data v]) to [players v]\n    end\nend\n\nwhen I receive [run lw v]\nset [reset? v] to [0]\nif <(length of [players v]) = [1]> then\n    say [Uploading data...]\n    Upload [Host] as player (ID)\n    set [old-mp v] to [2]\n    start script [60]\n    if <(reset?) = [1]> then\n        broadcast (run LW v)\n        stop [this script v]\n    end\nelse\n    if <<((days since 2000) * (86400)) > (☁ StartTime)> and <not <(☁ StartTime) = [0]>>> then\n        stop [other scripts in sprite v]\n        kick player (ID)\n        set [id v] to [0]\n    else\n        wait script\n        if <(reset?) = [1]> then\n            broadcast (run LW v)\n            stop [this script v]\n        end\n    end\nend\nif <(ID) = [0]> then\n    broadcast (spectate-race v)\n    show\n    if <([floor v] of (((days since 2000) * (86400)) - (☁ StartTime)) ) > [59]> then\n        say (join [You are late. The race has started ] (join ([floor v] of ((((days since 2000) * (86400)) - (☁ StartTime)) / (60)) ) [ minutes ago])) for (2) seconds\n    else\n        say (join [You are late. The race has started ] (join ([floor v] of (((days since 2000) * (86400)) - (☁ StartTime)) ) [ seconds ago])) for (2) seconds\n    end\nelse\n    broadcast (start-race v)\n    say [Go!] for (2) seconds\nend\nwait until <(☁ StartTime) = [0]>\nsay [The race has ended! Press the green flag.] for (5) seconds\nstop [all v]\n\ndefine Upload [Host] as player (id)\nrepeat (4)\n    set [☁ host v] to (id)\n    wait (0.15) seconds\nend\n\ndefine Upload [StartTime] as (time/status)\nrepeat (4)\n    set [☁ starttime v] to (time/status)\n    wait (0.15) seconds\nend\n\ndefine start script (time)\nif <(reset?) = [1]> then\n    stop [this script v]\nend\nUpload [StartTime] as [0]\nset [min. players v] to (old-mp)\nshow variable [min. players v]\nrepeat until <(length of [players v]) > ((Min. players) - (1))>\n    say (join [Waiting for players... \(] (join (length of [players v]) (join [ of ] (join (Min. players) [\)]))))\n    if <(reset?) = [1]> then\n        stop [this script v]\n    end\nend\nhide variable [min. players v]\nUpload [StartTime] as ([ceiling v] of (((days since 2000) * (86400)) + (time)) )\nrepeat until <((☁ StartTime) - ((days since 2000) * (86400))) < [1]>\n    if <(length of ([floor v] of ((☁ StartTime) - ((days since 2000) * (86400))) )) = [1]> then\n        set [remaining-time v] to (join [0] ([floor v] of ((☁ StartTime) - ((days since 2000) * (86400))) ))\n    else\n        set [remaining-time v] to ([floor v] of ((☁ StartTime) - ((days since 2000) * (86400))) )\n    end\n    say (join [The race will start in ] (join (join [0:] (remaining-time)) (join (join [. ] (length of [players v])) (join (join [ players of ] (Min. players)) [.]))))\n    if <(reset?) = [1]> then\n        stop [this script v]\n    end\n    if <(length of [players v]) < (Min. players)> then\n        say [Not enough players!]\n        set [old-mp v] to (Min. players)\n        start script (((☁ StartTime) - ((days since 2000) * (86400))) + (1))\n    end\nend\n\ndefine wait script\nif <(reset?) = [1]> then\n    stop [this script v]\nend\nrepeat until <not <(☁ StartTime) = [0]>>\n    say (join (length of [players v]) [ players have joined the game. Waiting for more players...])\n    if <(reset?) = [1]> then\n        stop [this script v]\n    end\nend\nrepeat until <<((☁ StartTime) - ((days since 2000) * (86400))) < [1]> and <not <(☁ StartTime) = [0]>>>\n    if <(length of ([floor v] of ((☁ StartTime) - ((days since 2000) * (86400))) )) = [1]> then\n        set [remaining-time v] to (join [0] ([floor v] of ((☁ StartTime) - ((days since 2000) * (86400))) ))\n    else\n        set [remaining-time v] to ([floor v] of ((☁ StartTime) - ((days since 2000) * (86400))) )\n    end\n    say (join [The race will start in ] (join (join [0:] (remaining-time)) (join (join [. ] (length of [players v])) [ players have joined the game.])))\n    if <(reset?) = [1]> then\n        stop [this script v]\n    end\n    if <(☁ StartTime) = [0]> then\n        wait script\n    end\nend\n\nwhen I receive [spectate-race v]\n--- [Update other players as spectator]\nset [update-pause v] to [0]\nforever\n    if <(update-pause) = [0]> then\n        Update\n    end\n    update players list\nend\n\nwhen I receive [spectate-race v]\n--- [Kick slow players]\nforever\n    if <<(item (1) of [player1 v]) < ((([x v] of [lineofdeath v]) + (240)) - (((item (7) of [player1 v]) - (1)) * (1920)))> and <not <(item (7) of [player1 v]) > ([current_level v] of [lineofdeath v])>>> then\n        kick player [1]\n    end\n    if <<(item (1) of [player2 v]) < ((([x v] of [lineofdeath v]) + (240)) - (((item (7) of [player1 v]) - (1)) * (1920)))> and <not <(item (7) of [player2 v]) > ([current_level v] of [lineofdeath v])>>> then\n        kick player [2]\n    end\n    if <<(item (1) of [player3 v]) < ((([x v] of [lineofdeath v]) + (240)) - (((item (7) of [player1 v]) - (1)) * (1920)))> and <not <(item (7) of [player3 v]) > ([current_level v] of [lineofdeath v])>>> then\n        kick player [3]\n    end\n    if <<(item (1) of [player4 v]) < ((([x v] of [lineofdeath v]) + (240)) - (((item (7) of [player1 v]) - (1)) * (1920)))> and <not <(item (7) of [player4 v]) > ([current_level v] of [lineofdeath v])>>> then\n        kick player [4]\n    end\n    if <<(item (1) of [player5 v]) < ((([x v] of [lineofdeath v]) + (240)) - (((item (7) of [player1 v]) - (1)) * (1920)))> and <not <(item (7) of [player5 v]) > ([current_level v] of [lineofdeath v])>>> then\n        kick player [5]\n    end\n    if <<(item (1) of [player6 v]) < ((([x v] of [lineofdeath v]) + (240)) - (((item (7) of [player1 v]) - (1)) * (1920)))> and <not <(item (7) of [player6 v]) > ([current_level v] of [lineofdeath v])>>> then\n        kick player [6]\n    end\n    if <<(item (1) of [player7 v]) < ((([x v] of [lineofdeath v]) + (240)) - (((item (7) of [player1 v]) - (1)) * (1920)))> and <not <(item (7) of [player7 v]) > ([current_level v] of [lineofdeath v])>>> then\n        kick player [7]\n    end\n    if <<(item (1) of [player8 v]) < ((([x v] of [lineofdeath v]) + (240)) - (((item (7) of [player1 v]) - (1)) * (1920)))> and <not <(item (7) of [player8 v]) > ([current_level v] of [lineofdeath v])>>> then\n        kick player [8]\n    end\nend\n\nwhen I receive [start v]\nbroadcast (run LW v)\n\n@Place\n\nwhen flag clicked\nhide\n\nwhen I receive [start-race v]\nupdate\nshow\ngo to [front v] layer\ngo to x: (-209) y: (151)\nforever\n    update\n    switch costume to (place)\n    go to [front v] layer\nend\n\ndefine update\nset [place v] to [1]\nset [maxid v] to [1]\nset [i3 v] to [0]\ndelete all of [sort v]\ndelete all of [max-values v]\nrepeat (8)\n    change [i3 v] by (1)\n    set [max v] to [0]\n    set [i2 v] to [0]\n    repeat (8)\n        change [i2 v] by (1)\n        get data of player (i2)\n        if <<((item (7) of [data v]) + (((item (1) of [data v]) + (960)) / (1920))) > (max)> and <<((item (7) of [data v]) + (((item (1) of [data v]) + (960)) / (1920))) < (item ((i3) - (1)) of [max-values v])> or <(i3) = [1]>>> then\n            set [max v] to ((item (7) of [data v]) + (((item (1) of [data v]) + (960)) / (1920)))\n            set [maxid v] to (i2)\n            if <(item (5) of [data v]) = [0]> then\n                set [maxid v] to []\n            end\n        end\n    end\n    add (max) to [max-values v]\n    add (maxID) to [sort v]\nend\nset [place v] to (item # of (ID) in [sort v])\n\ndefine get data of player (id)\ndelete all of [data v]\nset [i v] to [0]\nif <(id) = [1]> then\n    repeat (length of [player1 v])\n        change [i v] by (1)\n        add (item (i) of [player1 v]) to [data v]\n    end\nelse\n    if <(id) = [2]> then\n        repeat (length of [player2 v])\n            change [i v] by (1)\n            add (item (i) of [player2 v]) to [data v]\n        end\n    else\n        if <(id) = [3]> then\n            repeat (length of [player3 v])\n                change [i v] by (1)\n                add (item (i) of [player3 v]) to [data v]\n            end\n        else\n            if <(id) = [4]> then\n                repeat (length of [player4 v])\n                    change [i v] by (1)\n                    add (item (i) of [player4 v]) to [data v]\n                end\n            else\n                if <(id) = [5]> then\n                    repeat (length of [player5 v])\n                        change [i v] by (1)\n                        add (item (i) of [player5 v]) to [data v]\n                    end\n                else\n                    if <(id) = [6]> then\n                        repeat (length of [player6 v])\n                            change [i v] by (1)\n                            add (item (i) of [player6 v]) to [data v]\n                        end\n                    else\n                        if <(id) = [7]> then\n                            repeat (length of [player7 v])\n                                change [i v] by (1)\n                                add (item (i) of [player7 v]) to [data v]\n                            end\n                        else\n                            if <(id) = [8]> then\n                                repeat (length of [player8 v])\n                                    change [i v] by (1)\n                                    add (item (i) of [player8 v]) to [data v]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [spectate-race v]\nupdate\nshow\ngo to [front v] layer\ngo to x: (-209) y: (151)\nforever\n    update\n    get data of player (item (1) of [sort v])\n    if <(item (7) of [data v]) < [9]> then\n        set [followid v] to (item (1) of [sort v])\n    else\n        get data of player (item (2) of [sort v])\n        if <(item (7) of [data v]) < [9]> then\n            set [followid v] to (item (2) of [sort v])\n        else\n            get data of player (item (3) of [sort v])\n            if <(item (7) of [data v]) < [9]> then\n                set [followid v] to (item (3) of [sort v])\n            else\n                get data of player (item (4) of [sort v])\n                if <(item (7) of [data v]) < [9]> then\n                    set [followid v] to (item (4) of [sort v])\n                else\n                    get data of player (item (5) of [sort v])\n                    if <(item (7) of [data v]) < [9]> then\n                        set [followid v] to (item (5) of [sort v])\n                    else\n                        get data of player (item (6) of [sort v])\n                        if <(item (7) of [data v]) < [9]> then\n                            set [followid v] to (item (6) of [sort v])\n                        else\n                            get data of player (item (7) of [sort v])\n                            if <(item (7) of [data v]) < [9]> then\n                                set [followid v] to (item (7) of [sort v])\n                            else\n                                get data of player (item (8) of [sort v])\n                                if <(item (7) of [data v]) < [9]> then\n                                    set [followid v] to (item (8) of [sort v])\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    set [place v] to [1]\n    switch costume to (place)\n    go to [front v] layer\nend\n\n@LineOfDeath\n\nwhen flag clicked\nhide\n\nwhen I receive [start-race v]\nhide\ngo to [front v] layer\nset [oldt v] to ((days since 2000) * (86400))\nwait until <(((days since 2000) * (86400)) - (oldt)) > [90]>\nbroadcast (start LOD v)\nset [oldt v] to ((days since 2000) * (86400))\nforever\n    set [x v] to (((((((days since 2000) * (86400)) - (oldt)) / (60)) * (1920)) - (960)) - (480))\n    set [current_level v] to ([ceiling v] of ((((days since 2000) * (86400)) - (oldt)) / (60)) )\n    go to x: ((x) - (((Level) - (1)) * (1920))) y: (scrollY) \n    if <<(scrollX) < ((x) - (((Level) - (1)) * (1920)))> and <not <(Level) > (current_level)>>> then\n        go to x: (0) y: (0)\n        show\n    end\nend\n\ndefine go to x: (x) y: (y) <show?>\nset size to (500) %\ngo to x: (round (((x) - (scrollX)) * ((Zoom) / (100)))) y: (round (((y) - (scrollY)) * ((Zoom) / (100))))\nif <<<(x position) = (round (((x) - (scrollX)) * ((Zoom) / (100))))> and <(y position) = (round (((y) - (scrollY)) * ((Zoom) / (100))))>> and <show?>> then\n    show\nelse\n    hide\nend\nset size to (100) %\n\nwhen I receive [spectate-race v]\nhide\ngo to [front v] layer\nset [oldt v] to (☁ StartTime)\nwait until <(((days since 2000) * (86400)) - (oldt)) > [90]>\nset [oldt v] to ((☁ StartTime) + (90))\nforever\n    set [x v] to (((((((days since 2000) * (86400)) - (oldt)) / (60)) * (1920)) - (960)) - (480))\n    set [current_level v] to ([ceiling v] of ((((days since 2000) * (86400)) - (oldt)) / (60)) )\n    go to x: ((x) - (((Level) - (1)) * (1920))) y: (scrollY) \n    if <<(scrollX) < ((x) - (((Level) - (1)) * (1920)))> and <not <(Level) > (current_level)>>> then\n        go to x: (0) y: (0)\n        show\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\ngo to [front v] layer\n\ngo to [front v] layer\nclear graphic effects\nshow\n\n
Welcome to my new cloud multiplayer game!\nWhen you start the project, it will ask you "Min. players".\nChoose a number from 2 to 8 and when this number of players joins in, a countdown will start (1 minute)!\nThe race will start after the countdown.\nRace other players in 8 levels platformer.\nYou can touch blue and you can't touch red.\nYellow is bouncy, purple will teleport you.\nGreen is the goal of each level.