Scratch! A platformer 2

Instructions: Controls:\nArrows keys to move\nUp key to jump\nR to reset

@Stage\n\nwhen I receive [clear clones v]\nswitch backdrop to (sky v)\nset volume to (100) %\nplay sound [World 1 v] until done\n\nwhen flag clicked\nswitch backdrop to (intro v)\n\nwhen I receive [you won! v]\nrepeat (15)\n    change volume by (((0) - (volume)) / (1.5))\nend\nstop [other scripts in sprite v]\n\nwhen flag clicked\nforever\n    if <(Level) = [26]> then\n        switch backdrop to (pyramid v)\n        broadcast (Pyramid v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [29]> then\n        switch backdrop to (desert v)\n        broadcast (Desert v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [46]> then\n        switch backdrop to (snow v)\n        broadcast (Snow v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [52]> then\n        switch backdrop to (cave snow v)\n        broadcast (Underground v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [55]> then\n        switch backdrop to (clouds v)\n        broadcast (Sky v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [61]> then\n        switch backdrop to (lava v)\n        broadcast (Lava v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [16]> then\n        switch backdrop to (desert v)\n        broadcast (Desert v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [31]> then\n        switch backdrop to (beach v)\n        broadcast (Beach v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [43]> then\n        switch backdrop to (clouds v)\n        broadcast (Sky v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [desert v]\nstop all sounds\nplay sound [Desert Theme - New Super Mario Bros v] until done\n\nwhen I receive [pyramid v]\nstop all sounds\nplay sound [Shifting Sand Land Music v] until done\n\nwhen I receive [beach v]\nstop all sounds\nplay sound [14-water-land-overworld-nsmbwii-.mp3 v] until done\n\nwhen flag clicked\nforever\n    if <(Level) = [40]> then\n        broadcast (Beach v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [snow v]\nstop all sounds\nplay sound [Super Mario 64 - Cool Cool Mountain \[HQ Remix\] v] until done\n\nwhen I receive [lava v]\nstop all sounds\nplay sound [Volcano Theme - New Super Mario Bros v] until done\n\nwhen I receive [underwater v]\nstop all sounds\nplay sound [15-underwater-theme-nsmbwii-.mp3 v] until done\n\nwhen I receive [underground v]\nstop all sounds\nplay sound [Underground v] until done\n\nwhen flag clicked\nforever\n    if <(Level) = [1]> then\n        set [music v] to [0]\n        switch backdrop to (sky v)\n        broadcast (World 1 v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [castle v]\nstop all sounds\nplay sound [Castle theme Remix Version 2 - New Super Mario Bros v] until done\n\nwhen flag clicked\nforever\n    if <(Level) = [35]> then\n        broadcast (Underwater v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [sky v]\nstop all sounds\nplay sound [Overworld Athlet v] until done\n\nwhen flag clicked\nforever\n    if <(Level) = [65]> then\n        switch backdrop to (volcano v)\n        broadcast (Volcano v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [volcano v]\nstop all sounds\nplay sound [Newer Super Mario Bros Wii Music_ Freezeflame v] until done\n\n@Thumbnail\n\ngo to x: (0) y: (0)\ngo to [front v] layer\nclear graphic effects\nshow\nset [intro played? v] to [False]\nhide variable [players v]\n\nwhen flag clicked\nswitch costume to (thumbnail v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (0)\nrepeat (10)\n    change y by (((1) - (y position)) / (-1.5))\n    go to [front v] layer\n    change [ghost v] effect by (10)\nend\nhide\nforever\n    go to [front v] layer\nend\n\n@Intro\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nset size to (100) %\nset [id v] to [Background]\ncreate clone of (_myself_ v)\nset volume to (100) %\nstart sound [15 v]\nset [id v] to [Logo]\nswitch costume to (2 v)\ncreate clone of (_myself_ v)\nset [id v] to [Main]\nwait (0.4) seconds\nset [id v] to [Logo]\nswitch costume to (3 v)\ncreate clone of (_myself_ v)\nset [id v] to [Main]\nwait (0.3) seconds\nset [id v] to [Logo]\nswitch costume to (4 v)\ncreate clone of (_myself_ v)\nset [id v] to [Main]\nwait (0.2) seconds\nset [id v] to [Logo]\nswitch costume to (1-1 v)\ncreate clone of (_myself_ v)\nset [id v] to [Main]\nwait (0.5) seconds\nset [id v] to [Logo]\nswitch costume to (1-2 v)\ncreate clone of (_myself_ v)\nset [id v] to [Main]\nwait (1) seconds\nbroadcast (Move up v)\nwait (1) seconds\nset [id v] to [Presents]\nswitch costume to (lucasliu9595 v)\ncreate clone of (_myself_ v)\nset [id v] to [Main]\nwait (0.5) seconds\nset [id v] to [Presents]\nswitch costume to (presents v)\ncreate clone of (_myself_ v)\nset [id v] to [Main]\nwait (1.5) seconds\nbroadcast (Stop v)\n\nwhen I start as a clone\nshow\nif <(ID) = [Logo]> then\n    set size to (0) %\n    set [ghost v] effect to (100)\n    repeat until <(round (size)) = [125]>\n        change [ghost v] effect by (-5)\n        change size by (((125) - (size)) / (4))\n    end\n    set size to (125) %\nend\nif <(ID) = [Presents]> then\n    go to x: (0) y: (-1000)\n    set [ghost v] effect to (100)\n    repeat until <(round (y position)) = [-75]>\n        change [ghost v] effect by (-10)\n        change y by (((-75) - (y position)) / (3))\n    end\n    set y to (-75)\nend\nif <(ID) = [Background]> then\n    switch costume to (intro v)\n    set [ghost v] effect to (100)\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\nend\nif <(ID) = [Fade]> then\n    go to x: (0) y: (1000)\n    repeat until <(round (y position)) = [0]>\n        change y by (((0) - (y position)) / (5))\n    end\n    set y to (0)\nend\n\nwhen I receive [move up v]\nif <not <(ID) = [Background]>> then\n    repeat until <(round (y position)) = [40]>\n        change y by (((40) - (y position)) / (4))\n        change size by (((100) - (size)) / (4))\n    end\n    set y to (40)\n    set size to (100) %\nend\n\nwhen I receive [clear clones v]\nif <(ID) = [Fade]> then\n    set [ghost v] effect to (0)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\ndelete this clone\n\nwhen I receive [load done v]\nif <(ID) = [Main]> then\n    stop [other scripts in sprite v]\n    broadcast (Fade music v)\n    set [id v] to [Fade]\n    switch costume to (fade v)\n    create clone of (_myself_ v)\n    set [id v] to [Main]\n    wait (0.25) seconds\n    set [id v] to [Fade]\n    switch costume to (fade - 2 v)\n    create clone of (_myself_ v)\n    set [id v] to [Main]\n    wait (0.25) seconds\n    set [id v] to [Fade]\n    switch costume to (fade - 3 v)\n    create clone of (_myself_ v)\n    set [id v] to [Main]\n    wait (1.1) seconds\n    broadcast (Clear clones v)\n    stop [this script v]\nend\n\nwhen I receive [fade music v]\nset volume to (100) %\nrepeat (25)\n    change volume by (((0) - (volume)) / (4))\nend\nset volume to (0) %\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen I receive [clear clones v]\nreset timer\nset [player_shown? v] to [1]\nset [level v] to [1]\nset [xvel v] to [0]\nset [yvel v] to [0]\npoint in direction (90)\ngo to x: (-200) y: (-109)\nshow\nforever\n    switch costume to (hitbox v)\n    if <touching (water v)?> then\n        set [accel. speed v] to [0.4]\n        set [gravity v] to [-0.75]\n    else\n        set [accel. speed v] to [1]\n        set [gravity v] to [-1.25]\n    end\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n        point in direction (90)\n        change [xvel v] by (Accel. speed)\n    end\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n        point in direction (-90)\n        change [xvel v] by ((Accel. speed) * (-1))\n    end\n    set [xvel v] to ((Xvel) * (0.9))\n    change x by (Xvel)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < ((mouse y) - (15))>>> then\n                                if <(Xvel) > [0]> then\n                                    set [xvel v] to [-10]\n                                else\n                                    set [xvel v] to [10]\n                                end\n                            else\n                                change x by ((Xvel) * (-1))\n                                set [xvel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yvel v] by (Gravity)\n    change y by (Yvel)\n    if <touching (level v)?> then\n        change y by ((Yvel) * (-1))\n        set [yvel v] to [0]\n    end\n    change y by (-5)\n    if <<touching (death bars v)?> or <(y position) < [-180]>> then\n        start sound [Meow2 v]\n        set [xvel v] to [0]\n        set [yvel v] to [0]\n        go to x: (-200) y: (-109)\n    end\n    if <(x position) > [240]> then\n        start sound [Meow v]\n        change [level v] by (1)\n        go to x: (-200) y: (-109)\n    end\n    if <key (r v) pressed?> then\n        go to x: (-200) y: (-109)\n    end\n    if <touching (bounce pad v)?> then\n        set [yvel v] to [20]\n    end\n    if <touching (level v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < ((mouse y) - (15))>>> then\n            if <touching (water v)?> then\n                set [yvel v] to [11]\n            else\n                set [yvel v] to [15]\n            end\n        end\n    end\n    change y by (5)\n    set [player_x v] to (x position)\n    set [player_y v] to (y position)\n    set [location v] to (Level)\n    switch costume to (ID2)\nend\n\nwhen I receive [you won! v]\nstop [other scripts in sprite v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [reset v]\ngo to x: (-200) y: (-109)\n\n@Players on cloud\n\ndefine get data of player (p)\ndelete all of [data v]\nset [i v] to [0]\nif <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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                            else\n                                if <(p) = [9]> then\n                                    repeat (length of [player9 v])\n                                        change [i v] by (1)\n                                        add (item (i) of [player9 v]) to [data v]\n                                    end\n                                else\n                                    if <(p) = [10]> then\n                                        repeat (length of [player10 v])\n                                            change [i v] by (1)\n                                            add (item (i) of [player10 v]) to [data v]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nset size to (100) %\ngo to x: (-200) y: (-109)\npoint in direction (90)\nset [current_x v] to [0]\nset [current_y v] to [-130]\nset [ghost v] to [100]\nif <not <(pID) = (ID2)>> then\n    get data of player (pID)\n    set [current_x v] to (item (1) of [data v])\n    set [current_y v] to (item (2) of [data v])\n    point in direction (90)\n    go to x: (current_x) y: (current_y)\n    forever\n        get data of player (pID)\n        switch costume to (pID)\n        if <(item (5) of [data v]) = [1]> then\n            change [current_x v] by (((item (1) of [data v]) - (X)) / (3))\n            change [current_y v] by (((item (2) of [data v]) - (Y2)) / (3))\n            set [x v] to (current_x)\n            set [y2 v] to (current_y)\n            set size to (400) %\n            go to x: (current_x) y: (current_y)\n            set size to (50) %\n            set rotation style [left-right v]\n            if <((item (1) of [data v]) - (X)) > [0]> then\n                point in direction (90)\n            end\n            if <((item (1) of [data v]) - (X)) < [0]> then\n                point in direction (-90)\n            end\n        end\n        if <<(item (5) of [data v]) = [1]> and <<(item (6) of [data v]) = [1]> and <(item (7) of [data v]) = (Level)>>> then\n            show\n            think (item (4) of [data v])\n            change [ghost v] by (((0) - (Ghost)) / (3))\n        else\n            change [ghost v] by (((100) - (Ghost)) / (3))\n            if <(round (Ghost)) = [100]> then\n                hide\n            else\n                show\n                go to x: (current_x) y: (current_y)\n            end\n        end\n        set [ghost v] effect to (Ghost)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <not <(pID) = (ID2)>> then\n    get data of player (pID)\n    if <<(item (5) of [data v]) = [1]> and <(item (6) of [data v]) = [1]>> then\n        wait until <not <<(item (5) of [data v]) = [1]> and <(item (6) of [data v]) = [1]>>>\n        if <not <(length of [players v]) = [1]>> then\n            broadcast (Left v)\n        end\n    end\n    forever\n        if <<(item (5) of [data v]) = [1]> and <(item (6) of [data v]) = [1]>> then\n            start sound [Beep v]\n            broadcast (Join v)\n            wait until <not <<(item (5) of [data v]) = [1]> and <(item (6) of [data v]) = [1]>>>\n            broadcast (Left v)\n        end\n    end\nend\n\nwhen flag clicked\nhide variable [players v]\nforever\n    delete all of [all players v]\n    if <not <(item (4) of [player1 v]) = []>> then\n        add (item (4) of [player1 v]) to [all players v]\n    end\n    if <not <(item (4) of [player2 v]) = []>> then\n        add (item (4) of [player2 v]) to [all players v]\n    end\n    if <not <(item (4) of [player3 v]) = []>> then\n        add (item (4) of [player3 v]) to [all players v]\n    end\n    if <not <(item (4) of [player4 v]) = []>> then\n        add (item (4) of [player4 v]) to [all players v]\n    end\n    if <not <(item (4) of [player5 v]) = []>> then\n        add (item (4) of [player5 v]) to [all players v]\n    end\n    if <not <(item (4) of [player6 v]) = []>> then\n        add (item (4) of [player6 v]) to [all players v]\n    end\n    if <not <(item (4) of [player7 v]) = []>> then\n        add (item (4) of [player7 v]) to [all players v]\n    end\n    if <not <(item (4) of [player8 v]) = []>> then\n        add (item (4) of [player8 v]) to [all players v]\n    end\n    if <not <(item (4) of [player9 v]) = []>> then\n        add (item (4) of [player9 v]) to [all players v]\n    end\n    if <not <(item (4) of [player10 v]) = []>> then\n        add (item (4) of [player10 v]) to [all players v]\n    end\n    set [players v] to (length of [all players v])\nend\n\nwhen I receive [play v]\nshow variable [players v]\nset [pid v] to [0]\nrepeat (10)\n    change [pid v] by (1)\n    create clone of (_myself_ v)\nend\n\n@Level\n\nwhen flag clicked\nset [level v] to [1]\nhide\n\nwhen I receive [clear clones v]\ngo to x: (0) y: (0)\nFind\nclear graphic effects\nshow\nset [level v] to [1]\nforever\n    if <(Level) = (Total Levels)> then\n        set [ghost v] effect to (0)\n        broadcast (You Won! v)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        stop [this script v]\n    end\n    switch costume to (Level)\nend\n\ndefine Find\nswitch costume to (1 v)\nnext costume\nset [total levels v] to [1]\nrepeat until <(costume [name v]) = [1]>\n    change [total levels v] by (1)\n    next costume\nend\nswitch costume to (1 v)\n\nset [level v] to [61]\n\n@You Won!\n\nwhen flag clicked\nhide variable [complete time v]\nif <(Intro played?) = [True]> then\n    go to x: (0) y: (0)\n    set [ghost v] effect to (0)\n    repeat (10)\n        change y by (((1) - (y position)) / (-1.5))\n        go to [front v] layer\n        change [ghost v] effect by (10)\n    end\nend\nhide\nforever\n    go to [front v] layer\nend\n\nwhen I receive [you won! v]\nhide variable [players v]\nset [complete time v] to (timer)\nshow\nset x to (0)\nset y to (-1000)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\n    change y by (((0) - (y position)) / (2.5))\nend\nset y to (0)\nshow variable [complete time v]\n\nwhen I receive [you won! v]\nplay sound [YOU WON! v] until done\nstop [all v]\n\n@Death bars\n\nwhen flag clicked\nhide\n\nwhen I receive [clear clones v]\ngo to x: (0) y: (0)\nclear graphic effects\nshow\nforever\n    if <(Level) = (Total Levels)> then\n        set [ghost v] effect to (0)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        stop [this script v]\n    end\n    switch costume to (Level)\nend\n\n@Water\n\nwhen flag clicked\nhide\n\nwhen I receive [clear clones v]\ngo to x: (0) y: (0)\nclear graphic effects\nshow\nforever\n    if <(Level) = (Total Levels)> then\n        set [ghost v] effect to (0)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        stop [this script v]\n    end\n    switch costume to (Level)\nend\n\n@Bounce pad\n\nwhen flag clicked\nhide\n\nwhen I receive [clear clones v]\ngo to x: (0) y: (0)\nclear graphic effects\nshow\nforever\n    if <(Level) = (Total Levels)> then\n        set [ghost v] effect to (0)\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        stop [this script v]\n    end\n    switch costume to (Level)\nend\n\n@Multiplayer\n\ndefine save list on var\nif <(length of [list v]) = [0]> then\n    stop [this script v]\nend\ndelete (all) of [return v]\nset [item v] to [1]\nrepeat (length of [list v])\n    set [letter v] to [1]\n    repeat (length of (item (item) of [list v]))\n        set [symbol v] to [1]\n        repeat until <<(letter (symbol) of (characters)) = (letter (letter) of (item (item) of [list v]))> or <(symbol) > (length of (characters))>>\n            change [symbol v] by (1)\n        end\n        if <not <(symbol) > (length of (characters))>> then\n            if <not <(symbol) > [26]>> then\n                switch costume to (lowercase v)\n                switch costume to (letter (letter) of (item (item) of [list v]))\n                if <(costume [number v]) = [27]> then\n                    change [symbol v] by (26)\n                end\n            end\n            if <(length of (symbol)) < [2]> then\n                set [symbol v] to (join [0] (symbol))\n            end\n            add (letter (1) of (symbol)) to [return v]\n            add (letter (2) of (symbol)) to [return v]\n        end\n        change [letter v] by (1)\n    end\n    add (letter (1) of [0]) to [return v]\n    add (letter (1) of [0]) to [return v]\n    change [item v] by (1)\nend\nset [var v] to (return)\n\ndefine load (number) to list\ndelete (all) of [list v]\nset [item v] to []\nset [letter v] to [1]\nrepeat ((length of (number)) / (2))\n    set [symbol v] to (join (letter (letter) of (number)) (letter ((letter) + (1)) of (number)))\n    if <(symbol) = [0]> then\n        add (item) to [list v]\n        set [item v] to []\n    else\n        set [item v] to (join (item) (letter (symbol) of (characters)))\n    end\n    change [letter v] by (2)\nend\n\ndefine connect\nset percent from [0] / [10]\nset [tick v] to [0]\nset [id2 v] to [0]\ndelete all of [players v]\ndelete all of [slots v]\nrepeat (8)\n    add [0] to [slots v]\nend\nset percent from [0.25] / [10]\n--- [Player 1]\nload player [1]\nset [old-tick v] to (item (3) of [player1 v])\nif <(item (5) of [player1 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [1]\nend\nwait (0.25) seconds\nif <(item (3) of [player1 v]) = (old-tick)> then\n    reset player [1]\n    if <(ID2) = [0]> then\n        set [id2 v] to [1]\n        replace item (4) of [player1 v] with (username)\n        replace item (5) of [player1 v] with [1]\n        save player [1]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player1 v]) to [players v]\n    replace item (1) of [slots v] with [1]\nend\nset percent from [1] / [10]\n--- [Player 2]\nload player [2]\nset [old-tick v] to (item (3) of [player2 v])\nif <(item (5) of [player2 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [2]\nend\nwait (0.25) seconds\nif <(item (3) of [player2 v]) = (old-tick)> then\n    reset player [2]\n    if <(ID2) = [0]> then\n        set [id2 v] to [2]\n        replace item (4) of [player2 v] with (username)\n        replace item (5) of [player2 v] with [1]\n        save player [2]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player2 v]) to [players v]\n    replace item (2) of [slots v] with [1]\nend\nset percent from [2] / [10]\n--- [Player 3]\nload player [3]\nset [old-tick v] to (item (3) of [player3 v])\nif <(item (5) of [player3 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [3]\nend\nwait (0.25) seconds\nif <(item (3) of [player3 v]) = (old-tick)> then\n    reset player [3]\n    if <(ID2) = [0]> then\n        set [id2 v] to [3]\n        replace item (4) of [player3 v] with (username)\n        replace item (5) of [player3 v] with [1]\n        save player [3]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player3 v]) to [players v]\n    replace item (3) of [slots v] with [1]\nend\nset percent from [3] / [10]\n--- [Player 4]\nload player [4]\nset [old-tick v] to (item (3) of [player4 v])\nif <(item (5) of [player4 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [4]\nend\nwait (0.25) seconds\nif <(item (3) of [player4 v]) = (old-tick)> then\n    reset player [4]\n    if <(ID2) = [0]> then\n        set [id2 v] to [4]\n        replace item (4) of [player4 v] with (username)\n        replace item (5) of [player4 v] with [1]\n        save player [4]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player4 v]) to [players v]\n    replace item (4) of [slots v] with [1]\nend\nset percent from [4] / [10]\n--- [Player 5]\nload player [5]\nset [old-tick v] to (item (3) of [player5 v])\nif <(item (5) of [player5 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [5]\nend\nwait (0.25) seconds\nif <(item (3) of [player5 v]) = (old-tick)> then\n    reset player [5]\n    if <(ID2) = [0]> then\n        set [id2 v] to [5]\n        replace item (4) of [player5 v] with (username)\n        replace item (5) of [player5 v] with [1]\n        save player [5]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player5 v]) to [players v]\n    replace item (5) of [slots v] with [1]\nend\nset percent from [5] / [10]\n--- [Player 6]\nload player [6]\nset [old-tick v] to (item (3) of [player6 v])\nif <(item (5) of [player6 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [6]\nend\nwait (0.25) seconds\nif <(item (3) of [player6 v]) = (old-tick)> then\n    reset player [6]\n    if <(ID2) = [0]> then\n        set [id2 v] to [6]\n        replace item (4) of [player6 v] with (username)\n        replace item (5) of [player6 v] with [1]\n        save player [6]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player6 v]) to [players v]\n    replace item (6) of [slots v] with [1]\nend\nset percent from [6] / [10]\n--- [Player 7]\nload player [7]\nset [old-tick v] to (item (3) of [player7 v])\nif <(item (5) of [player7 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [7]\nend\nwait (0.25) seconds\nif <(item (3) of [player7 v]) = (old-tick)> then\n    reset player [7]\n    if <(ID2) = [0]> then\n        set [id2 v] to [7]\n        replace item (4) of [player7 v] with (username)\n        replace item (5) of [player7 v] with [1]\n        save player [7]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player7 v]) to [players v]\n    replace item (7) of [slots v] with [1]\nend\nset percent from [7] / [10]\n--- [Player 8]\nload player [8]\nset [old-tick v] to (item (3) of [player8 v])\nif <(item (5) of [player8 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [8]\nend\nwait (0.25) seconds\nif <(item (3) of [player8 v]) = (old-tick)> then\n    reset player [8]\n    if <(ID2) = [0]> then\n        set [id2 v] to [8]\n        replace item (4) of [player8 v] with (username)\n        replace item (5) of [player8 v] with [1]\n        save player [8]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player8 v]) to [players v]\n    replace item (8) of [slots v] with [1]\nend\nset percent from [8] / [10]\n--- [Player 9]\nload player [9]\nset [old-tick v] to (item (3) of [player9 v])\nif <(item (5) of [player9 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [9]\nend\nwait (0.25) seconds\nif <(item (3) of [player9 v]) = (old-tick)> then\n    reset player [9]\n    if <(ID2) = [0]> then\n        set [id2 v] to [9]\n        replace item (4) of [player9 v] with (username)\n        replace item (5) of [player9 v] with [1]\n        save player [9]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player9 v]) to [players v]\n    replace item (9) of [slots v] with [1]\nend\nset percent from [9] / [10]\n--- [Player 10]\nload player [10]\nset [old-tick v] to (item (3) of [player10 v])\nif <(item (5) of [player10 v]) = [1]> then\n    wait ((Offline Limit) / (1000)) seconds\n    load player [10]\nend\nwait (0.25) seconds\nif <(item (3) of [player10 v]) = (old-tick)> then\n    reset player [10]\n    if <(ID2) = [0]> then\n        set [id2 v] to [10]\n        replace item (4) of [player10 v] with (username)\n        replace item (5) of [player10 v] with [1]\n        save player [10]\n        add (username) to [players v]\n        broadcast (DEMOtick v)\n    end\nelse\n    add (item (4) of [player10 v]) to [players v]\n    replace item (10) of [slots v] with [1]\nend\nset percent from [10] / [10]\n\ndefine --- (label)\n\ndefine reset cloud\nset [c v] to [0]\nrepeat (8)\n    change [c v] by (1)\n    reset player (c)\n    save player (c)\nend\n\ndefine reset player (p)\nif <(p) = [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 [1] to [player1 v]\nelse\n    if <(p) = [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 [1] to [player2 v]\n    else\n        if <(p) = [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 [1] to [player3 v]\n        else\n            if <(p) = [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 [1] to [player4 v]\n            else\n                if <(p) = [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 [1] to [player5 v]\n                else\n                    if <(p) = [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 [1] to [player6 v]\n                    else\n                        if <(p) = [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 [1] to [player7 v]\n                        else\n                            if <(p) = [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 [1] to [player8 v]\n                            else\n                                if <(p) = [9]> then\n                                    delete all of [player9 v]\n                                    add [0] to [player9 v]\n                                    add [0] to [player9 v]\n                                    add [0] to [player9 v]\n                                    add [] to [player9 v]\n                                    add [0] to [player9 v]\n                                    add [0] to [player9 v]\n                                    add [1] to [player9 v]\n                                else\n                                    if <(p) = [10]> then\n                                        delete all of [player10 v]\n                                        add [0] to [player10 v]\n                                        add [0] to [player10 v]\n                                        add [0] to [player10 v]\n                                        add [] to [player10 v]\n                                        add [0] to [player10 v]\n                                        add [0] to [player10 v]\n                                        add [1] to [player10 v]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nsave player (p)\n\ndefine save player (p)\nset [i v] to [0]\ndelete all of [list v]\nif <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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                            else\n                                if <(p) = [9]> then\n                                    repeat (length of [player9 v])\n                                        change [i v] by (1)\n                                        add (item (i) of [player9 v]) to [list v]\n                                    end\n                                    save list on var\n                                    set [☁ p9 v] to (var)\n                                else\n                                    if <(p) = [10]> then\n                                        repeat (length of [player10 v])\n                                            change [i v] by (1)\n                                            add (item (i) of [player10 v]) to [list v]\n                                        end\n                                        save list on var\n                                        set [☁ p10 v] to (var)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine load player (p)\nset [i v] to [0]\nif <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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                            else\n                                if <(p) = [9]> then\n                                    load (☁ p9) to list\n                                    delete all of [player9 v]\n                                    repeat (length of [list v])\n                                        change [i v] by (1)\n                                        add (item (i) of [list v]) to [player9 v]\n                                    end\n                                else\n                                    if <(p) = [10]> then\n                                        load (☁ p10) to list\n                                        delete all of [player10 v]\n                                        repeat (length of [list v])\n                                            change [i v] by (1)\n                                            add (item (i) of [list v]) to [player10 v]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Update\nif <(ID2) = [1]> then\n    replace item (1) of [player1 v] with (round (player_x))\n    replace item (2) of [player1 v] with (round (player_y))\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 (player_shown?)\n    replace item (7) of [player1 v] with (Location)\nelse\n    if <(ID2) = [2]> then\n        replace item (1) of [player2 v] with (round (player_x))\n        replace item (2) of [player2 v] with (round (player_y))\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 (player_shown?)\n        replace item (7) of [player2 v] with (Location)\n    else\n        if <(ID2) = [3]> then\n            replace item (1) of [player3 v] with (round (player_x))\n            replace item (2) of [player3 v] with (round (player_y))\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 (player_shown?)\n            replace item (7) of [player3 v] with (Location)\n        else\n            if <(ID2) = [4]> then\n                replace item (1) of [player4 v] with (round (player_x))\n                replace item (2) of [player4 v] with (round (player_y))\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 (player_shown?)\n                replace item (7) of [player4 v] with (Location)\n            else\n                if <(ID2) = [5]> then\n                    replace item (1) of [player5 v] with (round (player_x))\n                    replace item (2) of [player5 v] with (round (player_y))\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 (player_shown?)\n                    replace item (7) of [player5 v] with (Location)\n                else\n                    if <(ID2) = [6]> then\n                        replace item (1) of [player6 v] with (round (player_x))\n                        replace item (2) of [player6 v] with (round (player_y))\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 (player_shown?)\n                        replace item (7) of [player6 v] with (Location)\n                    else\n                        if <(ID2) = [7]> then\n                            replace item (1) of [player7 v] with (round (player_x))\n                            replace item (2) of [player7 v] with (round (player_y))\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 (player_shown?)\n                            replace item (7) of [player7 v] with (Location)\n                        else\n                            if <(ID2) = [8]> then\n                                replace item (1) of [player8 v] with (round (player_x))\n                                replace item (2) of [player8 v] with (round (player_y))\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 (player_shown?)\n                                replace item (7) of [player8 v] with (Location)\n                            else\n                                if <(ID2) = [9]> then\n                                    replace item (1) of [player9 v] with (round (player_x))\n                                    replace item (2) of [player9 v] with (round (player_y))\n                                    replace item (3) of [player9 v] with (tick)\n                                    replace item (4) of [player9 v] with (username)\n                                    replace item (5) of [player9 v] with [1]\n                                    replace item (6) of [player9 v] with (player_shown?)\n                                    replace item (7) of [player9 v] with (Location)\n                                else\n                                    if <(ID2) = [10]> then\n                                        replace item (1) of [player10 v] with (round (player_x))\n                                        replace item (2) of [player10 v] with (round (player_y))\n                                        replace item (3) of [player10 v] with (tick)\n                                        replace item (4) of [player10 v] with (username)\n                                        replace item (5) of [player10 v] with [1]\n                                        replace item (6) of [player10 v] with (player_shown?)\n                                        replace item (7) of [player10 v] with (Location)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nsave player (ID2)\n\ndefine Tick\nchange [tick v] by (1)\nif <(tick) > [9]> then\n    set [tick v] to [0]\nend\n\ndefine Update Players\nif <not <(ID2) = [1]>> then\n    load player [1]\nend\nif <not <(ID2) = [2]>> then\n    load player [2]\nend\nif <not <(ID2) = [3]>> then\n    load player [3]\nend\nif <not <(ID2) = [4]>> then\n    load player [4]\nend\nif <not <(ID2) = [5]>> then\n    load player [5]\nend\nif <not <(ID2) = [6]>> then\n    load player [6]\nend\nif <not <(ID2) = [7]>> then\n    load player [7]\nend\nif <not <(ID2) = [8]>> then\n    load player [8]\nend\nif <not <(ID2) = [9]>> then\n    load player [9]\nend\nif <not <(ID2) = [10]>> then\n    load player [10]\nend\n\ndefine set percent from (1) / (2)\nset [connect-percent v] to ((1) / ((2) / (100)))\n\nwhen I receive [play v]\nset [player_shown? v] to [1]\nforever\n    wait (0.1) seconds\n    Update\n    Measure Memory\nend\n\nwhen I receive [play v]\nforever\n    Tick\n    wait (0.5) seconds\nend\n\nwhen I receive [play v]\nforever\n    Update Players\nend\n\ndefine Measure Memory\nif <(ID2) = [1]> then\n    set [memory v] to (join (join ([floor v] of (((length of (☁ p1)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p1)) [ of 128])) [\)]))\nelse\n    if <(ID2) = [2]> then\n        set [memory v] to (join (join ([floor v] of (((length of (☁ p2)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p2)) [ of 128])) [\)]))\n    else\n        if <(ID2) = [3]> then\n            set [memory v] to (join (join ([floor v] of (((length of (☁ p3)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p3)) [ of 128])) [\)]))\n        else\n            if <(ID2) = [4]> then\n                set [memory v] to (join (join ([floor v] of (((length of (☁ p4)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p4)) [ of 128])) [\)]))\n            else\n                if <(ID2) = [5]> then\n                    set [memory v] to (join (join ([floor v] of (((length of (☁ p5)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p5)) [ of 128])) [\)]))\n                else\n                    if <(ID2) = [6]> then\n                        set [memory v] to (join (join ([floor v] of (((length of (☁ p6)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p6)) [ of 128])) [\)]))\n                    else\n                        if <(ID2) = [7]> then\n                            set [memory v] to (join (join ([floor v] of (((length of (☁ p7)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p7)) [ of 128])) [\)]))\n                        else\n                            if <(ID2) = [8]> then\n                                set [memory v] to (join (join ([floor v] of (((length of (☁ p8)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p8)) [ of 128])) [\)]))\n                            else\n                                if <(ID2) = [9]> then\n                                    set [memory v] to (join (join ([floor v] of (((length of (☁ p9)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p9)) [ of 128])) [\)]))\n                                else\n                                    if <(ID2) = [10]> then\n                                        set [memory v] to (join (join ([floor v] of (((length of (☁ p10)) / (128)) * (100)) ) [% ]) (join (join [\(] (join (length of (☁ p10)) [ of 128])) [\)]))\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [demotick v]\nforever\n    Tick\n    Update\n    Update Players\n    Measure Memory\n    wait (0.5) seconds\nend\n\ndefine check player (p)\nload player (p)\nif <(item (5) of [list v]) = [0]> then\n    if <not <(item (4) of [list v]) = []>> then\n        reset player (p)\n    end\n    stop [this script v]\nend\nif <(p) = [1]> then\n    set [ot1 v] to (item (3) of [list v])\n    wait ((Offline Limit) / (1000)) seconds\n    load player (p)\n    if <(item (3) of [list v]) = (ot1)> then\n        reset player (p)\n    end\nelse\n    if <(p) = [2]> then\n        set [ot2 v] to (item (3) of [list v])\n        wait ((Offline Limit) / (1000)) seconds\n        load player (p)\n        if <(item (3) of [list v]) = (ot2)> then\n            reset player (p)\n        end\n    else\n        if <(p) = [3]> then\n            set [ot3 v] to (item (3) of [list v])\n            wait ((Offline Limit) / (1000)) seconds\n            load player (p)\n            if <(item (3) of [list v]) = (ot3)> then\n                reset player (p)\n            end\n        else\n            if <(p) = [4]> then\n                set [ot4 v] to (item (3) of [list v])\n                wait ((Offline Limit) / (1000)) seconds\n                load player (p)\n                if <(item (3) of [list v]) = (ot4)> then\n                    reset player (p)\n                end\n            else\n                if <(p) = [5]> then\n                    set [ot5 v] to (item (3) of [list v])\n                    wait ((Offline Limit) / (1000)) seconds\n                    load player (p)\n                    if <(item (3) of [list v]) = (ot5)> then\n                        reset player (p)\n                    end\n                else\n                    if <(p) = [6]> then\n                        set [ot6 v] to (item (3) of [list v])\n                        wait ((Offline Limit) / (1000)) seconds\n                        load player (p)\n                        if <(item (3) of [list v]) = (ot6)> then\n                            reset player (p)\n                        end\n                    else\n                        if <(p) = [7]> then\n                            set [ot7 v] to (item (3) of [list v])\n                            wait ((Offline Limit) / (1000)) seconds\n                            load player (p)\n                            if <(item (3) of [list v]) = (ot7)> then\n                                reset player (p)\n                            end\n                        else\n                            if <(p) = [8]> then\n                                set [ot8 v] to (item (3) of [list v])\n                                wait ((Offline Limit) / (1000)) seconds\n                                load player (p)\n                                if <(item (3) of [list v]) = (ot8)> then\n                                    reset player (p)\n                                end\n                            else\n                                if <(p) = [9]> then\n                                    set [ot9 v] to (item (3) of [list v])\n                                    wait ((Offline Limit) / (1000)) seconds\n                                    load player (p)\n                                    if <(item (3) of [list v]) = (ot9)> then\n                                        reset player (p)\n                                    end\n                                else\n                                    if <(p) = [9]> then\n                                        set [ot10 v] to (item (3) of [list v])\n                                        wait ((Offline Limit) / (1000)) seconds\n                                        load player (p)\n                                        if <(item (3) of [list v]) = (ot10)> then\n                                            reset player (p)\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [3]>> then\n        check player [3]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [4]>> then\n        check player [4]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [5]>> then\n        check player [5]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [6]>> then\n        check player [6]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [7]>> then\n        check player [7]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [8]>> then\n        check player [8]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [1]>> then\n        check player [1]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [2]>> then\n        check player [2]\n    end\nend\n\ndefine get data of player (p)\ndelete all of [data v]\nset [i v] to [0]\nif <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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 <(p) = [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                            else\n                                if <(p) = [9]> then\n                                    repeat (length of [player9 v])\n                                        change [i v] by (1)\n                                        add (item (i) of [player9 v]) to [data v]\n                                    end\n                                else\n                                    if <(p) = [10]> then\n                                        repeat (length of [player10 v])\n                                            change [i v] by (1)\n                                            add (item (i) of [player10 v]) to [data v]\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [connect & start v]\nset [characters v] to [ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~`!@#$%^&*\(\)-_=+\[\]{}/\|;:'",.<>? ]\nset [offline limit v] to [3000]\nset [id2 v] to [0]\nconnect\nsay []\nbroadcast (Load done v)\n\nwhen flag clicked\nbroadcast (connect & start v)\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [9]>> then\n        check player [9]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID2) = [10]>> then\n        check player [10]\n    end\nend\n\nwhen I receive [clear clones v]\nif <(ID2) = [0]> then\n    broadcast (Game full! v) and wait\nelse\n    if <(length of [players v]) = [1]> then\n        broadcast (Playing alone v)\n    else\n        broadcast (Found active game v)\n    end\nend\nstop [other scripts in sprite v]\nbroadcast (play v)\n\n@Progress Bar\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nshow\nif <(Progress Bar: ID) = [Light]> then\n    switch costume to (progress bar v)\n    set x to ((-480) + (((480) / (100)) * (connect-percent)))\n    forever\n        set size to (400) %\n        change x by ((((-480) + (((480) / (100)) * (connect-percent))) - (x position)) / (1.5))\n        set y to (-178)\n        set size to (100) %\n    end\nelse\n    if <(Progress Bar: ID) = [Dark]> then\n        switch costume to (progress bar dark v)\n        go to x: (0) y: (-178)\n    else\n        delete this clone\n    end\nend\n\nwhen I receive [play v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\nwhen flag clicked\nset [connect-percent v] to [0]\nset [progress bar: id v] to [Dark]\ncreate clone of (_myself_ v)\nset [progress bar: id v] to [Light]\ncreate clone of (_myself_ v)\nset [progress bar: id v] to [Main]\n\nwhen I start as a clone\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [game full! v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\nwhen I receive [load done v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\n@Screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nswitch costume to (connecting v)\nhide\n\nwhen I receive [play v]\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen I receive [game full! v]\nshow\nset [ghost v] effect to (100)\nset [brightness v] effect to (100)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\nswitch costume to (game full! v)\nset [brightness v] effect to (100)\nrepeat (10)\n    go to [front v] layer\n    change [brightness v] effect by (-10)\nend\nwait (2) seconds\nbroadcast (Spectator Mode v)\n\n@Join/Left messages\n\nwhen I receive [join v]\nstop [other scripts in sprite v]\nbroadcast (Join message v)\nswitch costume to (joined v)\nshow\ngo to x: (0) y: (1000)\nset [ghost v] effect to (100)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\n    change y by (((0) - (y position)) / (2.5))\nend\nclear graphic effects\nset y to (0)\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    change y by (((-1) - (y position)) / (-1.25))\nend\nhide\n\nwhen I receive [left v]\nstop [other scripts in sprite v]\nbroadcast (Left message v)\nswitch costume to (left v)\nshow\ngo to x: (0) y: (1000)\nset [ghost v] effect to (100)\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\n    change y by (((0) - (y position)) / (2.5))\nend\nclear graphic effects\nset y to (0)\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\n    change y by (((-1) - (y position)) / (-1.25))\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [join message v]\nset language to (en v)::tts\nset voice to (tenor v)::tts\nspeak [A player has joined the game.]::tts\n\nwhen I receive [left message v]\nset language to (en v)::tts\nset voice to (tenor v)::tts\nspeak [A player has left the game.]::tts\n\n@Reset\n\n@Sprite1\n\n@Sprite2\n\n