Meltdown | Online Multiplayer Platformer Battle

Instructions: Meltdown 2 is out!\nhttps://scratch.mit.edu/projects/942325592\n\n        @UrbanSkeleton Presents...\n\n           -- MELTDOWN --\nAbout: \n This project was made for @Coolbe22 's 2.5K Game Contest. This game has 2 modes: Singleplayer and Multiplayer. On Singleplayer, you fight against red monster things (There AI is completely Human Like) that spawn at random with an avg of 1 monster per 15 seconds. On Multiplayer, you fight in an Arena against other players, trying to get as many kills as possible.\n\n     ⚠️⚠️  MOBILE NOT SUPPORTED  ⚠️⚠️\n⚠️⚠️  ALL MULTIPLAYER LAG IS BECAUSE OF SLOW         CLOUD VARIABLES  ⚠️⚠️\n  ⚠️⚠️  NEW SCRATCHERS CAN'T PLAY  ⚠️⚠️\n   ⚠️⚠️  ALL ADS WILL BE REPORTED  ⚠️⚠️\n\nInstructions:\n - WASD/Arrow keys to move\n - Space to shoot\n - T to open chat\n - 1, 2 ... 8, 9 to use chat options\n - Q to quit the game\n - On Multiplayer, avoid radiation rise, and attack\n  other players!\n - On Singleplayer, attack the red monsters, and don't\n  let them come close!\n\nFeatures:\n - Multiplayer and Singleplayer modes\n - Radiation that rises once in a while\n - An awesome level!\n - Infinite Multiplayer!\n - Absolutely flawless AI!\nDon't believe me? Try it out!\n\nCredits:\n - @Griffpatch for the tile based platformer tutorials\n - @Xshrunk for the multiplayer engine\n - @KIKOKO_ for some of the vectors (Waste Barrel)\n - AI made by me\n - All other coding + art by me\n - Music - Xtrullor - Supernova\n\nEnjoy!\n\n\nWow this is my first project that got 1000 views!\n\n\n\n\n\n\n\n\n\n\n\nTags:\n#all #games #nuclear #cloud #toxic #meltdown #tiled #epic #ebic #epik #epick #ebik #ebick #contestentry #ai #noice

@Stage\n\nwhen I receive [green flag v]\nforever\n    set volume to (40) %\n    play sound [Xtrullor - Supernova v] until done\nend\n\ndefine Set Default Values\nset [intro v] to [1]\nset [overall kills v] to [0]\nset [mode v] to [1]\n\n@Player\n\ndefine Render HP Bar | Max Health: (max) Current Health: (health) Size of Bar (size)\nchange y by (30)\nchange x by (25)\nset pen color to (#a7a7a7)\nset pen size to ((size) + (2))\npen down\nchange x by (-50)\nset pen color to (#f30000)\nset pen (color v) to (((health) / (max)) * (30))\nset pen size to ((size) * (1.3))\nchange x by (((health) / (max)) * (50))\npen up\nPosition\n\ndefine Move Camera\nchange [camx v] by (round ((((x) + (((mouse x) / (10)) + ((SpeedX) * (5)))) - (CamX)) / (5)))\nchange [camy v] by (round ((((y) + ((mouse y) / (6))) - (CamY)) / (5)))\nif <(Editor) > [0]> then\n    Limit Camera | Edge X: [240] Edge Y: [180]\nelse\n    Limit Camera | Edge X: [245] Edge Y: [180]\nend\n\ndefine Reset Player\nset rotation style [left-right v]\ndelete all of [shoot buffer v]\nset [playerwidth v] to [15]\nset [playerheight v] to [14]\nset [speedx v] to [0]\nset [speedy v] to [0]\nRandom Spawn\nset [rise v] to [-100]\nset [camx v] to (x)\nset [camy v] to (y)\nset [falling v] to [0]\nset [health v] to [150]\nset [kills v] to [0]\nMove Camera\nbroadcast (Reset v)\nwait (1) seconds\n\ndefine Game Loop\nReset Player\nstart sound [Connect v]\nrepeat until <key (q v) pressed?>\n    broadcast (Check Controls v)\n    broadcast (Move Player v)\n    broadcast (Position v)\n    change [~tick v] by (1)\n    set [~tick v] to ((~Tick) mod (1000000))\nend\nstart sound [Disconnect v]\nbroadcast (Quit v) and wait\n\nwhen I receive [move player v]\nif <(Editor) > [0]> then\n    Handle God Mode\nelse\n    Handle Keys - Left/Right\n    Handle Keys - Jump/Crouch\n    Move X\n    Move Y\n    Check Around Player\n    set [shoot v] to [0]\n    if <(length of [shoot buffer v]) > [2]> then\n        delete (1) of [shoot buffer v]\n    end\n    if <<<key (space v) pressed?> or <mouse down?>> and <(timer) > [0.5]>> then\n        reset timer\n        set [shoot v] to [1]\n        broadcast (Shoot v)\n    end\n    add (Shoot) to [shoot buffer v]\n    if <touching (enemy ai v)?> then\n        change [health v] by (-0.5)\n        broadcast (Attacked v)\n    end\n    if <<(pick random (1) to (500)) = [500]> and <(Mode) = [0]>> then\n        create clone of (enemy ai v)\n    end\n    if <(Health) > [150]> then\n        set [health v] to [150]\n    end\nend\nMove Camera\nPaint Sprite\n\ndefine Position\ngo to x: ((x) - (CamX)) y: ((y) - (CamY))\n\ndefine Get List Pos | X: (x) Y: (y)\nset [playerongridx v] to ([floor v] of ((x) / (32)) )\nset [playerongridy v] to ([floor v] of ((y) / (32)) )\nset [playerlistpos v] to ((1) + ((PlayerOnGridY) + ((WorldY) * (PlayerOnGridX))))\nif <(PlayerOnGridY) < [0]> then\n    set [playerlistpostiletype v] to []\nelse\n    if <(Mode) = [1]> then\n        set [playerlistpostiletype v] to (item (PlayerListPos) of [multiplayer level v])\n    else\n        set [playerlistpostiletype v] to (item (PlayerListPos) of [single player level v])\n    end\nend\n\ndefine Fix Collision in Direction | DX: (dx) DY: (dy)\nset [fixdx v] to (dx)\nset [fixdy v] to (dy)\nset [solid v] to [0]\nFix Collision at Point | X: (x) Y: ((y) - (PlayerHeight))\nFix Collision at Point | X: (x) Y: (y)\nFix Collision at Point | X: (x) Y: ((y) + (PlayerHeight))\nFix Collision at Point | X: ((x) + (PlayerWidth)) Y: (y)\nFix Collision at Point | X: ((x) - (PlayerWidth)) Y: (y)\nFix Collision at Point | X: ((x) + (PlayerWidth)) Y: ((y) - (PlayerHeight))\nFix Collision at Point | X: ((x) - (PlayerWidth)) Y: ((y) - (PlayerHeight))\nFix Collision at Point | X: ((x) + (PlayerWidth)) Y: ((y) + (PlayerHeight))\nFix Collision at Point | X: ((x) - (PlayerWidth)) Y: ((y) + (PlayerHeight))\n\ndefine Fix Collision at Point | X: (x) Y: (y)\nGet List Pos | X: (x) Y: (y)\nif <<(PlayerListPosTileType) > [1]> and <(PlayerListPosTileType) < [18]>> then\n    set [solid v] to [10]\n    set [modx v] to ((x) mod (32))\n    set [mody v] to ((y) mod (32))\n    if <(FixDy) < [0]> then\n        change [y v] by ((32) - (ModY))\n    end\n    if <(FixDx) < [0]> then\n        change [x v] by ((32) - (ModX))\n    end\n    if <(FixDy) > [0]> then\n        change [y v] by ((-0.01) - (ModY))\n    end\n    if <(FixDx) > [0]> then\n        change [x v] by ((-0.01) - (ModX))\n    end\nend\n\ndefine Handle Keys - Left/Right\nset [walkkeypress v] to ([xaxis v] of [controls v])\nset [speedx v] to (((SpeedX) * (0.6)) + (((WalkKeyPress) / (() + (1))) * (4)))\n\ndefine Handle Keys - Jump/Crouch\nchange [speedy v] by (-2)\nif <(SpeedY) < [-22]> then\n    set [speedy v] to [-22]\nend\nif <<([yaxis v] of [controls v]) > [0]> and <(Falling) < [3]>> then\n    set [speedy v] to [17]\nend\n\ndefine Move Y\nchange [y v] by (SpeedY)\nchange [falling v] by (1)\nFix Collision in Direction | DX: [0] DY: (round (SpeedY))\nif <(Solid) > [0]> then\n    if <(SpeedY) < [0]> then\n        set [falling v] to [0]\n    end\n    set [speedy v] to [0]\nend\n\ndefine Move X\nchange [x v] by (SpeedX)\nFix Collision in Direction | DX: (round (SpeedX)) DY: [0]\nif <(Solid) > [0]> then\n    set [speedx v] to [0]\nend\n\ndefine Paint Sprite\nerase all\nset rotation style [all around v]\npoint towards (mouse-pointer v)\nif <(direction) > [0]> then\n    switch costume to (weapon 1 r v)\nelse\n    switch costume to (weapon 1 l v)\nend\nPosition\ncreate clone of (_myself_ v)\nswitch costume to (player v)\nset rotation style [left-right v]\nRender HP Bar | Max Health: [150] Current Health: (Health) Size of Bar [5]\nsay (item ([saying v] of [chat v]) of [chat v])\n\ndefine Handle God Mode\nchange [speedx v] by ((6) * ([xaxis v] of [controls v]))\nchange [speedy v] by ((6) * ([yaxis v] of [controls v]))\nset [speedx v] to ((0.7) * (SpeedX))\nset [speedy v] to ((0.7) * (SpeedY))\nchange [x v] by (SpeedX)\nchange [y v] by (SpeedY)\n\ndefine Check Around Player\nif <<<(y) < [0]> or <(Health) < [0]>> or <(y) < (Rise)>> then\n    start sound [Death v]\n    Reset Player\n    Position\n    set [killed by v] to []\nend\n\ndefine Limit Camera | Edge X: (x) Edge Y: (y)\nif <(CamX) < (x)> then\n    set [camx v] to (x)\nend\nif <(CamY) < (y)> then\n    set [camy v] to (y)\nend\nif <(CamX) > (((32) * (WorldX)) - (240))> then\n    set [camx v] to (((32) * (WorldX)) - (240))\nend\nif <(CamY) > (((32) * (WorldY)) - (180))> then\n    set [camy v] to (((32) * (WorldY)) - (180))\nend\n\nwhen I receive [green flag v]\nforever\n    hide\n    broadcast (Menu v) and wait\n    set [killed by v] to []\n    delete all of [kill block v]\n    show\n    broadcast (Generate Level v) and wait\n    broadcast (Clone Level Tiles v) and wait\n    broadcast (init v)\n    Game Loop\nend\n\nwhen I receive [check controls v]\ndelete this clone\n\nwhen I start as a clone\ngo [forward v] (1) layers\n\ndefine Random Spawn\nif <(Mode) = [1]> then\n    if <(pick random (1) to (4)) = [4]> then\n        set [x v] to [72]\n        set [y v] to [620]\n    else\n        if <(pick random (1) to (3)) = [3]> then\n            set [x v] to [1020]\n            set [y v] to [555]\n        else\n            if <(pick random (1) to (2)) = [2]> then\n                set [x v] to [365]\n                set [y v] to [810]\n            else\n                set [x v] to [990]\n                set [y v] to [845]\n            end\n        end\n    end\nelse\n    set [x v] to [640]\n    set [y v] to [170]\nend\n\nwhen I receive [menu v]\ndelete this clone\n\nwhen I receive [shoot v]\nstart sound [Shoot v]\n\nwhen flag clicked\nhide\nif <(Intro) = [1]> then\n    wait (6.3) seconds\nend\nbroadcast (Green Flag v)\n\n@Bullet\n\ndefine Move | Steps: (steps) If Hit Perfection: (perfection)\nswitch costume to (hit v)\nchange [x v] by ((Sin) * (steps))\nchange [y v] by ((Cos) * (steps))\nPosition\nif <<touching (enemy ai v)?> or <<touching (_edge_ v)?> or <touching (tiles v)?>>> then\n    set [hit v] to [1]\n    if <touching (_edge_ v)?> then\n        change [hit v] by (1)\n    end\n    set [try v] to (steps)\n    repeat (perfection)\n        change [x v] by ((0) - ((Sin) * (try)))\n        change [y v] by ((0) - ((Cos) * (try)))\n        change [try v] by ((0) - ((steps) / (perfection)))\n        change [x v] by ((Sin) * (try))\n        change [y v] by ((Cos) * (try))\n        Position\n        if <not <<touching (enemy ai v)?> and <<touching (_edge_ v)?> and <touching (tiles v)?>>>> then\n            change [x v] by ((Sin) * ((steps) / (perfection)))\n            change [y v] by ((Cos) * ((steps) / (perfection)))\n            Position\n            switch costume to (radioactive v)\n            stop [this script v]\n        end\n    end\nend\nswitch costume to (radioactive v)\n\nwhen I receive [position v]\nif <(costume [number v]) = [1]> then\n    if <(Shoot) = [1]> then\n        set [x v] to ([x v] of [player v])\n        set [y v] to ([y v] of [player v])\n        Position\n        point towards (mouse-pointer v)\n        set [sin v] to ([sin v] of (direction) )\n        set [cos v] to ([cos v] of (direction) )\n        set [speed v] to [40]\n        switch costume to (radioactive v)\n        create clone of (_myself_ v)\n        switch costume to (main v)\n    end\nend\nPosition\n\nwhen flag clicked\nhide\nswitch costume to (main v)\n\nwhen I start as a clone\nchange [x v] by ((Sin) * (10))\nchange [y v] by ((Cos) * (10))\nshow\nset [hit v] to [0]\nset [t v] to [0]\nclear graphic effects\nset [ghost v] effect to (50)\nset size to (50) %\nrepeat until <<(Hit) > [0]> or <(t) > [100]>>\n    Move | Steps: (round (Speed)) If Hit Perfection: [2]\n    set [speed v] to ((Speed) * (0.9))\n    change [t v] by (1)\n    change [ghost v] effect by (0.5)\n    change size by (3)\nend\nif <(Hit) = [1]> then\n    set [speed v] to ((Speed) * (0.1))\n    repeat until <(t) > [100]>\n        change [t v] by (2)\n        change [ghost v] effect by (1)\n        change [x v] by ((Sin) * (Speed))\n        change [y v] by ((Cos) * (Speed))\n        Position\n        change size by (1)\n        set [speed v] to ((Speed) * (0.9))\n        if <touching (enemy ai v)?> then\n            wait (0.01) seconds\n            delete this clone\n        end\n    end\nend\nwait (0.01) seconds\ndelete this clone\n\ndefine Position\ngo to x: (round ((x) - (CamX))) y: (round ((y) - (CamY)))\n\n@Cloud\n\ndefine Init\ndelete all of [@players v]\ndelete all of [@ids v]\ndelete all of [@playeroffset v]\ndelete all of [#checkactive v]\ndelete all of [#checkvalue v]\ndelete all of [#cloudlist v]\ndelete all of [clouddata v]\nadd (join [=] (☁ Cloud1)) to [clouddata v]\nadd (join [=] (☁ Cloud2)) to [clouddata v]\nadd (join [=] (☁ Cloud3)) to [clouddata v]\nadd (join [=] (☁ Cloud4)) to [clouddata v]\nadd (join [=] (☁ Cloud5)) to [clouddata v]\nadd (join [=] (☁ Cloud6)) to [clouddata v]\nadd (join [=] (☁ Cloud7)) to [clouddata v]\nadd (join [=] (☁ Cloud8)) to [clouddata v]\nset [@id v] to (([floor v] of ((days since 2000) * (100000000)) ) mod (1000))\n\ndefine Process Cloud (id) (var)\nif <(var) = (item (id) of [clouddata v])> then\n    stop [this script v]\nend\nreplace item (id) of [clouddata v] with (var)\nDecode (var)\nif <<(item (2) of [decoded v]) = (username)> and <(item (5) of [decoded v]) = (@ID)>> then\n    stop [this script v]\nend\nFind Player (item (2) of [decoded v]) (item (5) of [decoded v])\nif <(~i) = [0]> then\n    set [~i v] to (item # of [] in [@players v])\n    if <(~i) = [0]> then\n        New Player\n    else\n        replace item (~i) of [@players v] with (item (2) of [decoded v])\n        replace item (~i) of [@ids v] with (item (5) of [decoded v])\n    end\nend\nset [~j v] to [1]\nrepeat (length of [decoded v])\n    replace item ((((~i) - (1)) * (&MaxElements)) + (~j)) of [#cloudlist v] with (item (~j) of [decoded v])\n    change [~j v] by (1)\nend\n\ndefine Read Cloud\nProcess Cloud [1] (join [=] (☁ Cloud1))\nProcess Cloud [2] (join [=] (☁ Cloud2))\nProcess Cloud [3] (join [=] (☁ Cloud3))\nProcess Cloud [4] (join [=] (☁ Cloud4))\nProcess Cloud [5] (join [=] (☁ Cloud5))\nProcess Cloud [6] (join [=] (☁ Cloud6))\nProcess Cloud [7] (join [=] (☁ Cloud7))\nProcess Cloud [8] (join [=] (☁ Cloud8))\n\ndefine Decode (clouddata)\ndelete all of [decoded v]\nset [~temp v] to []\nset [~i v] to [2]\nrepeat (((length of (clouddata)) - (1)) / (2))\n    switch costume to (join (letter (~i) of (clouddata)) (letter ((~i) + (1)) of (clouddata)))\n    if <(costume [number v]) = [1]> then\n        add (~temp) to [decoded v]\n        set [~temp v] to []\n    else\n        set [~temp v] to (join (~temp) (costume [name v]))\n    end\n    change [~i v] by (2)\nend\n\ndefine Encode\nset [~temp v] to []\nset [~i v] to [1]\nrepeat (length of [#playerlist v])\n    set [~j v] to [1]\n    repeat (length of (item (~i) of [#playerlist v]))\n        switch costume to (letter (~j) of (item (~i) of [#playerlist v]))\n        if <(costume [number v]) < [10]> then\n            set [~temp v] to (join (~temp) (join [0] (costume [number v])))\n        else\n            set [~temp v] to (join (~temp) (costume [number v]))\n        end\n        change [~j v] by (1)\n    end\n    set [~temp v] to (join (~temp) [01])\n    change [~i v] by (1)\nend\n\ndefine SaveToCloud (playerid)\nSavePlayer\nEncode\nif <(playerid) < [6]> then\n    if <(playerid) < [3]> then\n        if <(playerid) = [1]> then\n            set [☁ cloud1 v] to (~temp)\n        else\n            set [☁ cloud2 v] to (~temp)\n        end\n    else\n        if <(playerid) = [3]> then\n            set [☁ cloud3 v] to (~temp)\n        else\n            if <(playerid) = [4]> then\n                set [☁ cloud4 v] to (~temp)\n            else\n                set [☁ cloud5 v] to (~temp)\n            end\n        end\n    end\nelse\n    if <(playerid) < [8]> then\n        if <(playerid) = [6]> then\n            set [☁ cloud6 v] to (~temp)\n        else\n            set [☁ cloud7 v] to (~temp)\n        end\n    else\n        if <(playerid) = [8]> then\n            set [☁ cloud8 v] to (~temp)\n        end\n    end\nend\n\nwhen I receive [position v]\nif <(Mode) = [1]> then\n    UpdatePlayersList [1]\n    Read Cloud\n    SaveToCloud (pick random (1) to (length of [clouddata v]))\n    CountPlayers\n    UpdatePlayersList [0]\nelse\n    hide\nend\n\ndefine CountPlayers\nset [#playersonline v] to [1]\nset [~i v] to [1]\nrepeat (length of [@players v])\n    if <(item (~i) of [#checkactive v]) = [1]> then\n        change [#playersonline v] by (1)\n    end\n    change [~i v] by (1)\nend\nif <(#PlayersOnline) > [1]> then\n    hide\nelse\n    if <(username) = []> then\n        switch costume to (log in v)\n    else\n        if <(☁ Online) = [0]> then\n            switch costume to (new v)\n        else\n            switch costume to (alone v)\n        end\n    end\n    show\nend\ngo to [front v] layer\nif <<(☁ Online) < [0]> and <not <(username) = [UrbanSkeleton]>>> then\n    switch costume to (offline v)\n    show\n    stop [all v]\nend\nif <<not <(Version) = (☁ Online)>> and <(☁ Online) > [0]>> then\n    switch costume to (update v)\n    show\n    stop [all v]\nend\n\nwhen I receive [init v]\nInit\n\ndefine UpdatePlayersList (first)\nif <(first) = [1]> then\n    set [~c v] to [0]\n    repeat (length of [@players v])\n        if <not <<(item (((~c) * (&MaxElements)) + (2)) of [#cloudlist v]) = (username)> and <(item (((~c) * (&MaxElements)) + (5)) of [#cloudlist v]) = (@ID)>>> then\n            if <(item ((~c) + (1)) of [@playeroffset v]) = [0]> then\n                replace item ((~c) + (1)) of [#checkvalue v] with (item (((~c) * (&MaxElements)) + (1)) of [#cloudlist v])\n            end\n            replace item ((~c) + (1)) of [@playeroffset v] with ((item ((~c) + (1)) of [@playeroffset v]) + (1))\n        end\n        change [~c v] by (1)\n    end\nelse\n    set [~c v] to [0]\n    repeat (length of [@players v])\n        if <not <<(item (((~c) * (&MaxElements)) + (2)) of [#cloudlist v]) = (username)> and <(item (((~c) * (&MaxElements)) + (5)) of [#cloudlist v]) = (@ID)>>> then\n            if <<not <(item ((~c) + (1)) of [#checkvalue v]) = (item (((~c) * (&MaxElements)) + (1)) of [#cloudlist v])>> or <(item ((~c) + (1)) of [@playeroffset v]) > [99]>> then\n                if <<(item ((~c) + (1)) of [#checkvalue v]) = (item (((~c) * (&MaxElements)) + (1)) of [#cloudlist v])> or <(item (((~c) * (&MaxElements)) + (5)) of [#cloudlist v]) = [X]>> then\n                    replace item ((~c) + (1)) of [#checkactive v] with [0]\n                    replace item ((~c) + (1)) of [@players v] with []\n                    replace item ((~c) + (1)) of [@ids v] with []\n                else\n                    replace item ((~c) + (1)) of [#checkactive v] with [1]\n                end\n                replace item ((~c) + (1)) of [@playeroffset v] with [0]\n            end\n        end\n        change [~c v] by (1)\n    end\nend\n\ndefine EmptyCloud\nset [☁ cloud1 v] to []\nwait (0.1) seconds\nset [☁ cloud2 v] to []\nwait (0.1) seconds\nset [☁ cloud3 v] to []\nwait (0.1) seconds\nset [☁ cloud4 v] to []\nwait (0.1) seconds\nset [☁ cloud5 v] to []\nwait (0.1) seconds\nset [☁ cloud6 v] to []\nwait (0.1) seconds\nset [☁ cloud7 v] to []\nwait (0.1) seconds\nset [☁ cloud8 v] to []\n\ndefine SavePlayer\ndelete all of [#playerlist v]\nadd (~Tick) to [#playerlist v]\nadd (username) to [#playerlist v]\nadd (round ([x v] of [player v])) to [#playerlist v]\nadd (round ([y v] of [player v])) to [#playerlist v]\nadd (@ID) to [#playerlist v]\nadd (round ([direction v] of [player v])) to [#playerlist v]\nadd (item (1) of [shoot buffer v]) to [#playerlist v]\nadd (item (2) of [shoot buffer v]) to [#playerlist v]\nadd (item (3) of [shoot buffer v]) to [#playerlist v]\nadd (Health) to [#playerlist v]\nadd (Killed by) to [#playerlist v]\nadd ([saying v] of [chat v]) to [#playerlist v]\n\ndefine New Player\nadd (item (2) of [decoded v]) to [@players v]\nadd (item (5) of [decoded v]) to [@ids v]\nadd [0] to [@playeroffset v]\nadd [0] to [#checkactive v]\nadd [0] to [#checkvalue v]\nrepeat (&MaxElements)\n    add [0] to [#cloudlist v]\nend\ncreate clone of (opponents v)\n\ndefine Find Player (name) (id)\nset [~i v] to [0]\nrepeat (length of [@players v])\n    change [~i v] by (1)\n    if <<(item (~i) of [@players v]) = (name)> and <(item (~i) of [@ids v]) = (id)>> then\n        stop [this script v]\n    end\nend\nset [~i v] to [0]\n\nwhen I receive [menu v]\nhide\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\nif <(Mode) = [1]> then\n    set [last v] to [1]\n    set [&maxelements v] to [12]\n    set [version v] to [6]\n    if <(username) = [UrbanSkeleton]> then\n        wait (0.1) seconds\n        set [☁ online v] to (Version)\n    end\n    if <(#PlayersOnline) > [0]> then\n        replace item (5) of [#playerlist v] with [X]\n        repeat (10)\n            SaveToCloud (pick random (1) to (length of [clouddata v]))\n        end\n    end\n    set [#playersonline v] to [0]\nend\n\nset [☁ online v] to [-1]\n\n@Opponents\n\nwhen I receive [position v]\nif <(Clone) > [0]> then\n    if <not <(item ((((Clone) - (1)) * (&MaxElements)) + (2)) of [#cloudlist v]) = (username)>> then\n        if <(Clone Type) = [P]> then\n            if <(item (Clone) of [#checkactive v]) = [1]> then\n                set size to (400) %\n                change [x v] by (((item ((((Clone) - (1)) * (&MaxElements)) + (3)) of [#cloudlist v]) - (x)) / (4))\n                change [y v] by (((item ((((Clone) - (1)) * (&MaxElements)) + (4)) of [#cloudlist v]) - (y)) / (4))\n                Position\n                if <<(round ((x) - (CamX))) = (x position)> and <(round ((y) - (CamY))) = (y position)>> then\n                    show\n                    set [username v] to (item ((((Clone) - (1)) * (&MaxElements)) + (2)) of [#cloudlist v])\n                    if <(item ((((Clone) - (1)) * (&MaxElements)) + (12)) of [#cloudlist v]) > [0]> then\n                        say (item (item ((((Clone) - (1)) * (&MaxElements)) + (12)) of [#cloudlist v]) of [chat v])\n                    else\n                        say (Username)\n                    end\n                    point in direction (item ((((Clone) - (1)) * (&MaxElements)) + (6)) of [#cloudlist v])\n                    set rotation style [all around v]\n                    if <(direction) > [0]> then\n                        switch costume to (weapon r v)\n                    else\n                        switch costume to (weapon l v)\n                    end\n                    set [clone type v] to [G]\n                    create clone of (_myself_ v)\n                    set [clone type v] to [P]\n                    switch costume to (player v)\n                    set rotation style [left-right v]\n                    if <(length of [shoot v]) = [0]> then\n                        add (item ((((Clone) - (1)) * (&MaxElements)) + (7)) of [#cloudlist v]) to [shoot v]\n                        add (item ((((Clone) - (1)) * (&MaxElements)) + (8)) of [#cloudlist v]) to [shoot v]\n                        add (item ((((Clone) - (1)) * (&MaxElements)) + (9)) of [#cloudlist v]) to [shoot v]\n                    end\n                    if <(item (1) of [shoot v]) = [1]> then\n                        set [speed v] to [40]\n                        set [clone type v] to [B]\n                        create clone of (_myself_ v)\n                        set [clone type v] to [P]\n                        broadcast (Test v)\n                    end\n                    delete (1) of [shoot v]\n                    Render HP Bar | Max Health: [150] Current Health: (item ((((Clone) - (1)) * (&MaxElements)) + (10)) of [#cloudlist v]) Size of Bar [5]\n                    if <(username) = (item ((((Clone) - (1)) * (&MaxElements)) + (11)) of [#cloudlist v])> then\n                        if <not <[kill block v] contains (Username)?>> then\n                            start sound [Death v]\n                            change [kills v] by (1)\n                            change [health v] by (50)\n                            change [overall kills v] by (1)\n                            add (Username) to [kill block v]\n                        end\n                    else\n                        delete (item # of (Username) in [kill block v]) of [kill block v]\n                    end\n                    show\n                else\n                    hide\n                end\n            else\n                hide\n            end\n        end\n    end\nelse\n    hide\nend\n\nwhen I receive [init v]\nset [clones v] to [0]\nset [clone v] to [0]\nset [clone type v] to [P]\n\nwhen I start as a clone\nif <(Clone Type) = [P]> then\n    delete all of [shoot v]\n    change [clones v] by (1)\n    set [clone v] to (Clones)\nelse\n    if <(Clone Type) = [B]> then\n        start sound [Shoot v]\n        switch costume to (radioactive v)\n        set [sin v] to ([sin v] of (direction) )\n        set [cos v] to ([cos v] of (direction) )\n        change [x v] by ((Sin) * (30))\n        change [y v] by ((Cos) * (30))\n        show\n        set [hit v] to [0]\n        set [t v] to [0]\n        clear graphic effects\n        set [ghost v] effect to (50)\n        set size to (50) %\n        repeat until <<(Hit) > [0]> or <(t) > [100]>>\n            Move | Steps: (round (Speed)) If Hit Perfection: [1]\n            set [speed v] to ((Speed) * (0.9))\n            change [t v] by (1)\n            change [ghost v] effect by (0.5)\n            change size by (3)\n            if <<touching (player v)?> and <(Attacked) = [0]>> then\n                change [health v] by (-1.5)\n                set [attacked v] to [1]\n                broadcast (Attacked v)\n                if <(Health) < [0.1]> then\n                    set [killed by v] to (Username)\n                    broadcast (Killed v)\n                end\n            end\n        end\n        if <(Hit) = [1]> then\n            set [speed v] to ((Speed) * (0.1))\n            repeat until <(t) > [100]>\n                change [t v] by (2)\n                change [ghost v] effect by (1)\n                change [x v] by ((Sin) * (Speed))\n                change [y v] by ((Cos) * (Speed))\n                Position\n                change size by (1)\n                set [speed v] to ((Speed) * (0.9))\n                if <<touching (player v)?> and <(Attacked) = [0]>> then\n                    change [health v] by (-1.5)\n                    broadcast (Attacked v)\n                    set [@id v] to [0]\n                    if <(Health) < [0.1]> then\n                        set [killed by v] to (Username)\n                        broadcast (Killed v)\n                    end\n                end\n            end\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [check controls v]\nif <(Clone Type) = [G]> then\n    delete this clone\nend\n\ndefine Move | Steps: (steps) If Hit Perfection: (perfection)\nswitch costume to (hit v)\nchange [x v] by ((Sin) * (steps))\nchange [y v] by ((Cos) * (steps))\nPosition\nif <<touching (_edge_ v)?> or <touching (tiles v)?>> then\n    set [hit v] to [1]\n    if <touching (_edge_ v)?> then\n        change [hit v] by (1)\n    end\n    set [try v] to (steps)\n    repeat (perfection)\n        change [x v] by ((0) - ((Sin) * (try)))\n        change [y v] by ((0) - ((Cos) * (try)))\n        change [try v] by ((0) - ((steps) / (perfection)))\n        change [x v] by ((Sin) * (try))\n        change [y v] by ((Cos) * (try))\n        Position\n        if <not <<touching (_edge_ v)?> and <touching (tiles v)?>>> then\n            change [x v] by ((Sin) * ((steps) / (perfection)))\n            change [y v] by ((Cos) * ((steps) / (perfection)))\n            Position\n            switch costume to (radioactive v)\n            stop [this script v]\n        end\n    end\nend\nswitch costume to (radioactive v)\n\ndefine Position\ngo to x: (round ((x) - (CamX))) y: (round ((y) - (CamY)))\n\nwhen I receive [menu v]\nhide\ndelete this clone\n\ndefine Render HP Bar | Max Health: (max) Current Health: (health) Size of Bar (size)\nchange y by (30)\nchange x by (25)\nset pen color to (#a7a7a7)\nset pen size to ((size) + (2))\npen down\nchange x by (-50)\nset pen color to (#f30000)\nset pen (color v) to (((health) / (max)) * (30))\nset pen size to ((size) * (1.3))\nchange x by (((health) / (max)) * (50))\npen up\nPosition\n\nwhen I receive [killed v]\nwait (0.2) seconds\nset [killed by v] to []\n\n@Enemy AI\n\ndefine Reset Enemy\nset rotation style [left-right v]\nset [width v] to [15]\nset [height v] to [14]\nif <(pick random (1) to (2)) = [1]> then\n    set [x v] to [812]\nelse\n    set [x v] to [490]\nend\nset [y v] to [90]\nset [speedx v] to [0]\nset [speedy v] to [0]\nset [falling v] to [0]\nset [jumping v] to [0]\nset size to (400) %\nset [hp v] to [15]\n\ndefine Position\ngo to x: (round ((x) - (CamX))) y: (round ((y) - (CamY)))\n\ndefine Get List Pos | X: (x) Y: (y)\nset [enemyongridx v] to ([floor v] of ((x) / (32)) )\nset [enemyongridy v] to ([floor v] of ((y) / (32)) )\nset [enemylistpos v] to ((1) + ((EnemyOnGridY) + ((WorldY) * (EnemyOnGridX))))\nif <(EnemyOnGridY) < [0]> then\n    set [enemylistpostiletype v] to []\nelse\n    set [enemylistpostiletype v] to (item (EnemyListPos) of [single player level v])\nend\n\ndefine Fix Collision in Direction | DX: (dx) DY: (dy)\nset [fixdx v] to (dx)\nset [fixdy v] to (dy)\nset [solid v] to [0]\nFix Collision at Point | X: ((x) + (Width)) Y: ((y) + (Height))\nFix Collision at Point | X: (x) Y: ((y) + (Height))\nFix Collision at Point | X: ((x) - (Width)) Y: ((y) + (Height))\nFix Collision at Point | X: ((x) + (Width)) Y: ((y) - (Height))\nFix Collision at Point | X: (x) Y: ((y) - (Height))\nFix Collision at Point | X: ((x) - (Width)) Y: ((y) - (Height))\nFix Collision at Point | X: ((x) + (Width)) Y: (y)\nFix Collision at Point | X: (x) Y: (y)\nFix Collision at Point | X: ((x) - (Width)) Y: (y)\n\ndefine Fix Collision at Point | X: (x) Y: (y)\nGet List Pos | X: (x) Y: (y)\nset [current solid v] to [0]\nif <<(EnemyListPosTileType) > [1]> and <(EnemyListPosTileType) < [18]>> then\n    set [solid v] to [1]\n    set [current solid v] to [1]\n    set [modx v] to ((x) mod (32))\n    set [mody v] to ((y) mod (32))\n    if <(FixDy) < [0]> then\n        change [y v] by ((32) - (ModY))\n    end\n    if <(FixDx) < [0]> then\n        change [x v] by ((32) - (ModX))\n    end\n    if <(FixDy) > [0]> then\n        change [y v] by ((-0.01) - (ModY))\n    end\n    if <(FixDx) > [0]> then\n        change [x v] by ((-0.01) - (ModX))\n    end\nend\n\ndefine Handle Movement | MoveX: (x) MoveY: (y)\nset [walkkeypress v] to (x)\nset [speedx v] to (((SpeedX) * (0.6)) + ((WalkKeyPress) * (3.5)))\nif <([abs v] of (WalkKeyPress) ) > [0]> then\n    point in direction ((WalkKeyPress) * (90))\nend\nchange [speedy v] by (-2)\nif <(SpeedY) < [-22]> then\n    set [speedy v] to [-22]\nend\nif <<(y) > [0]> and <(Falling) < [3]>> then\n    set [speedy v] to [17]\nend\n\ndefine Move Y\nchange [y v] by (SpeedY)\nchange [falling v] by (1)\nFix Collision in Direction | DX: [0] DY: (round (SpeedY))\nif <(Solid) > [0]> then\n    if <(SpeedY) < [0]> then\n        set [falling v] to [0]\n    else\n        set [jumping v] to [90]\n    end\n    set [speedy v] to [0]\nend\n\ndefine Move X\nchange [x v] by (SpeedX)\nFix Collision in Direction | DX: (round (SpeedX)) DY: [0]\nif <(Solid) > [0]> then\n    set [speedx v] to [0]\nend\n\ndefine Paint Sprite\nPosition\nset [ghost v] effect to ((75) - ((HP) * (5)))\nif <<(round ((x) - (CamX))) = (x position)> and <(round ((y) - (CamY))) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Check Around Enemy\nif <(y) < [0]> then\n    Reset Enemy\nend\n\nwhen I receive [reset v]\nif <(Mode) = [0]> then\n    Reset Enemy\nend\n\nwhen I receive [init v]\nwait (5) seconds\nif <(Mode) = [0]> then\n    forever\n        set [jump? v] to [0]\n        set [xdecision v] to [0]\n        if <<(distance to [player v]) > [100]> or <(Falling) > [0]>> then\n            if <([x v] of [player v]) > (x)> then\n                set [xdecision v] to [1]\n            else\n                set [xdecision v] to [-1]\n            end\n            Handle Wall\n            Handle Gap\n        else\n            point towards (player v)\n        end\n        Handle Movement | MoveX: (XDecision) MoveY: (Jump?)\n        Move X\n        Move Y\n    end\nend\n\nwhen I receive [position v]\nif <(Mode) = [0]> then\n    show\n    Paint Sprite\n    Check Around Enemy\n    if <touching (bullet v)?> then\n        change [hp v] by (-1)\n    end\n    if <(HP) < [1]> then\n        change size by (25)\n        change [ghost v] effect by (2)\n    end\n    if <(size) > [600]> then\n        change [health v] by (10)\n        change [kills v] by (1)\n        start sound [Death v]\n        Reset Enemy\n        delete this clone\n    end\nelse\n    hide\nend\n\ndefine Handle Wall\nGet List Pos | X: ((x) + (((Width) + (1)) * (XDecision))) Y: ((y) - (1))\nif <<(EnemyListPosTileType) > [1]> and <(EnemyListPosTileType) < [18]>> then\n    set [jump? v] to [1]\n    set [speedy v] to [1]\n    repeat until <(SpeedY) < [1]>\n        Handle Movement | MoveX: (XDecision) MoveY: (Jump?)\n        Move X\n        Move Y\n    end\n    set [enemylistpostiletype v] to [1]\n    repeat until <<(EnemyListPosTileType) > [1]> and <(EnemyListPosTileType) < [18]>>\n        Handle Movement | MoveX: [0] MoveY: [0]\n        Move X\n        Move Y\n        Get List Pos | X: (x) Y: (((y) - (Height)) - (1))\n    end\n    Get List Pos | X: ((x) + (((Width) + (1)) * (XDecision))) Y: ((y) - (-1))\n    if <<(EnemyListPosTileType) > [1]> and <(EnemyListPosTileType) < [18]>> then\n        set [xdecision v] to ((XDecision) * (-1))\n        set [enemylistpostiletype v] to [1]\n        set [ground v] to (y)\n        repeat until <<(EnemyListPosTileType) > [1]> and <(EnemyListPosTileType) < [18]>>\n            Handle Movement | MoveX: (XDecision) MoveY: [1]\n            Move X\n            Move Y\n            Get List Pos | X: (x) Y: ((y) - ((Height) + ((y) - (Ground))))\n            if <not <(y) > (Ground)>> then\n                stop [this script v]\n            end\n        end\n        set [enemylistpostiletype v] to [1]\n        repeat until <<(EnemyListPosTileType) > [1]> and <(EnemyListPosTileType) < [18]>>\n            Handle Movement | MoveX: [0] MoveY: [1]\n            Move X\n            Move Y\n            Get List Pos | X: (x) Y: ((y) - ((Height) + (1)))\n        end\n    end\n    set [xdecision v] to ((XDecision) * (-1))\n    repeat (3)\n        Handle Movement | MoveX: (XDecision) MoveY: [0]\n        Move X\n        Move Y\n    end\nend\n\ndefine Handle Gap\nGet List Pos | X: ((x) + ((Width) * (XDecision))) Y: ((y) - ((Height) + (1)))\nset [ground v] to (y)\nif <not <<(EnemyListPosTileType) > [1]> and <(EnemyListPosTileType) < [18]>>> then\n    set [jump? v] to [1]\nend\n\nwhen I receive [quit v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nReset Enemy\nif <(Mode) = [0]> then\n    forever\n        set [jump? v] to [0]\n        set [xdecision v] to [0]\n        if <<(distance to [player v]) > [5]> or <(Falling) > [0]>> then\n            if <([x v] of [player v]) > (x)> then\n                set [xdecision v] to [1]\n            else\n                set [xdecision v] to [-1]\n            end\n            Handle Wall\n            Handle Gap\n        else\n            point towards (player v)\n        end\n        Handle Movement | MoveX: (XDecision) MoveY: (Jump?)\n        Move X\n        Move Y\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Tiles\n\ndefine Setup\nshow\nset [selfindex v] to [1]\nset [selfx v] to [16]\nrepeat (TileCountX)\n    set [selfy v] to [16]\n    repeat (TileCountY)\n        set [selftype v] to (pick random (1) to (3))\n        create clone of (_myself_ v)\n        change [selfy v] by (32)\n        change [selfindex v] by (1)\n    end\n    change [selfx v] by (32)\n    change [selfindex v] by ((WorldY) - (TileCountY))\nend\nhide\nset [selfindex v] to []\n\ndefine Position\nif <(SelfIndex) = []> then\n    Editor Brush\nelse\n    switch costume to (big v)\n    if <([abs v] of ((SelfX) - (CamX)) ) > ((TileCountX) * (16))> then\n        if <(SelfX) < (CamX)> then\n            Loop Tile X | Skip: (TileCountX)\n        else\n            Loop Tile X | Skip: ((TileCountX) * (-1))\n        end\n    end\n    if <([abs v] of ((SelfY) - (CamY)) ) > ((TileCountY) * (16))> then\n        if <(SelfY) < (CamY)> then\n            Loop Tile Y | Skip (TileCountY)\n        else\n            Loop Tile Y | Skip ((TileCountY) * (-1))\n        end\n    end\n    if <(Mode) = [1]> then\n        set [selftype v] to (item (SelfIndex) of [multiplayer level v])\n    else\n        set [selftype v] to (item (SelfIndex) of [single player level v])\n    end\nend\ngo to x: ((SelfX) - (CamX)) y: ((SelfY) - (CamY))\nif <(SelfType) < [1]> then\n    set [selftype v] to [1]\nend\nswitch costume to (SelfType)\n\nwhen I receive [position v]\nPosition\n\ndefine Loop Tile X | Skip: (skip)\nchange [selfx v] by ((skip) * (32))\nchange [selfindex v] by ((skip) * (WorldY))\n\ndefine Loop Tile Y | Skip (skip)\nchange [selfy v] by ((skip) * (32))\nchange [selfindex v] by (skip)\n\nwhen I receive [clone level tiles v]\nset size to (405) %\ngo to x: (0) y: (0)\npoint in direction (90)\nset [tilecountx v] to [16]\nset [tilecounty v] to [13]\nSetup\n\ndefine Editor Brush\nif <<mouse down?> or <(Editor) < [1]>> then\n    hide\n    stop [this script v]\nend\nset [selfx v] to (((32) * ([editorongridx v] of [editor v])) + (16))\nset [selfy v] to (((32) * ([editorongridy v] of [editor v])) + (16))\nset [selftype v] to ([selectedbrush v] of [editor v])\nset [ghost v] effect to (20)\nshow\n\nwhen I receive [menu v]\nhide\ndelete this clone\n\n@Toxic Rise\n\nwhen flag clicked\nhide\n\nwhen I receive [position v]\nif <(Mode) = [1]> then\n    set [rise v] to ((([cos v] of ((days since 2000) * (80000)) ) * (300)) + (10))\n    go to x: (0) y: (((Rise) + (([cos v] of ((days since 2000) * (9600000)) ) * (15))) - (CamY))\n    show\nelse\n    hide\nend\n\n@Menu\n\nwhen flag clicked\nhide\n\nwhen I receive [menu v]\nMenu\nrepeat until <<touching (mouse-pointer v)?> and <mouse down?>>\n    erase all\n    go to x: (0) y: (-100)\n    if <touching (mouse-pointer v)?> then\n        change size by (((110) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\nend\nstart sound [Wood Tap v]\nbroadcast (Close Menu v)\n\ndefine Menu\ngo to x: (0) y: (0)\nswitch costume to (select 1 v)\nshow\nrepeat (6)\n    create clone of (_myself_ v)\n    next costume\nend\nswitch costume to (play v)\n\nwhen I receive [generate level v]\nhide\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <(costume [name v]) = [Selector]> then\n        change y by ((((Mode) * (50)) - (y position)) / (5))\n        set x to (0)\n    else\n        if <(costume [name v]) = [Select 1]> then\n            go to x: (0) y: (0)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                set [mode v] to [0]\n            end\n        else\n            if <(costume [name v]) = [Select 2]> then\n                go to x: (0) y: (50)\n                if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                    set [mode v] to [1]\n                end\n            else\n                if <(costume [name v]) = [BG]> then\n                    go to x: (0) y: (([cos v] of ((timer) * (60)) ) * (10))\n                    go to [front v] layer\n                else\n                    if <(costume [name v]) = [Smoker]> then\n                        if <(pick random (1) to (10)) = [10]> then\n                            go to x: (pick random (-230) to (230)) y: (-500)\n                            set size to (pick random (10) to (50)) %\n                            switch costume to (smoke v)\n                            create clone of (_myself_ v)\n                            switch costume to (smoker v)\n                        end\n                    else\n                        if <(costume [name v]) = [Smoke]> then\n                            set [ghost v] effect to ((((y position) + (180)) / (8)) + (60))\n                            set [brightness v] effect to (-10)\n                            change size by (0.25)\n                            change y by ((size) / (100))\n                            change x by ([cos v] of ((y position) * (5)) )\n                            if <(y position) > [150]> then\n                                delete this clone\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Fade\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\ngo to x: (0) y: (0)\nclear graphic effects\nshow\ngo to [front v] layer\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\n    go to [front v] layer\nend\n\nwhen I receive [quit v]\ngo to x: (0) y: (0)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [menu v]\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\n    go to [front v] layer\nend\n\n@Editor\n\ndefine Generate Level\nif <(Mode) = [1]> then\n    delete all of [multiplayer level v]\nelse\n    delete all of [single player level v]\nend\nset [worldx v] to [40]\nset [worldy v] to [30]\nAdd Wall Column | Type: [2]\nrepeat ((WorldX) - (2))\n    Add Boxed Column | Type: [2]\nend\nAdd Wall Column | Type: [2]\n\ndefine Add Wall Column | Type: (type)\nif <(Mode) = [1]> then\n    repeat (WorldY)\n        add (type) to [multiplayer level v]\n    end\nelse\n    repeat (WorldY)\n        add (type) to [single player level v]\n    end\nend\n\ndefine Add Boxed Column | Type: (type)\nif <(Mode) = [1]> then\n    add (type) to [multiplayer level v]\n    repeat ((WorldY) - (2))\n        add [1] to [multiplayer level v]\n    end\n    add (type) to [multiplayer level v]\nelse\n    add (type) to [single player level v]\n    repeat ((WorldY) - (2))\n        add [1] to [single player level v]\n    end\n    add (type) to [single player level v]\nend\n\nwhen I receive [generate level v]\nset [editor v] to [0]\nset [selectedbrush v] to [4]\nset [editorbrush v] to [0]\nif <(Mode) = [1]> then\n    if <(length of [multiplayer level v]) = [0]> then\n        Generate Level\n    end\nelse\n    if <(length of [single player level v]) = [0]> then\n        Generate Level\n    end\nend\n\nwhen I receive [move player v]\nif <(Editor) < [1]> then\n    stop [this script v]\nend\nGet List Pos | X: ((mouse x) + (CamX)) Y: ((mouse y) + (CamY))\nif <not <mouse down?>> then\n    set [editorbrush v] to [0]\n    stop [this script v]\nend\nif <(EditorBrush) = [0]> then\n    if <(EditorListPosTileType) = (SelectedBrush)> then\n        set [editorbrush v] to [1]\n    else\n        set [editorbrush v] to (SelectedBrush)\n    end\nend\nif <(Mode) = [1]> then\n    replace item (EditorListPos) of [multiplayer level v] with (EditorBrush)\nelse\n    replace item (EditorListPos) of [single player level v] with (EditorBrush)\nend\n\ndefine Get List Pos | X: (x) Y: (y)\nset [editorongridx v] to ([floor v] of ((x) / (32)) )\nset [editorongridy v] to ([floor v] of ((y) / (32)) )\nset [editorlistpos v] to ((1) + ((EditorOnGridY) + ((WorldY) * (EditorOnGridX))))\nif <(Mode) = [1]> then\n    set [editorlistpostiletype v] to (item (EditorListPos) of [multiplayer level v])\nelse\n    set [editorlistpostiletype v] to (item (EditorListPos) of [single player level v])\nend\n\nwhen [1 v] key pressed\nNext Brush | Catigory: [1]\n\nwhen [2 v] key pressed\nNext Brush | Catigory: [2]\n\nwhen [3 v] key pressed\nNext Brush | Catigory: [3]\n\nwhen [0 v] key pressed\nif <(username) = [UrbanSkeleton]> then\n    if <(Editor) > [0]> then\n        set [editor v] to [0]\n    else\n        set [editor v] to [1]\n    end\nend\n\ndefine Next Brush | Catigory: (category)\nrepeat (length of [tile key map v])\n    if <(SelectedBrush) < (length of [tile key map v])> then\n        change [selectedbrush v] by (1)\n    else\n        set [selectedbrush v] to [1]\n    end\n    if <(item (SelectedBrush) of [tile key map v]) = (category)> then\n        stop [this script v]\n    end\nend\n\nwhen [e v] key pressed\nset [selectedbrush v] to (EditorListPosTileType)\n\nwhen [4 v] key pressed\nNext Brush | Catigory: [4]\n\n@Controls\n\nwhen I receive [check controls v]\nset [attacked v] to [0]\nset [left v] to <<key (left arrow v) pressed?> or <key (a v) pressed?>>\nset [right v] to <<key (right arrow v) pressed?> or <key (d v) pressed?>>\nset [up v] to <<key (up arrow v) pressed?> or <key (w v) pressed?>>\nset [down v] to <<key (down arrow v) pressed?> or <key (s v) pressed?>>\nset [xaxis v] to ((Right) - (Left))\nset [yaxis v] to ((Up) - (Down))\n\n@Screen\n\nwhen I receive [position v]\nSetup String | String: (join [k] (Kills)) | At | X: [-200] Y: [150]\nif <(Kills) > (☁ Record)> then\n    set [☁ record v] to (Kills)\nend\nif <(Mode) = [0]> then\n    Setup String | String: (join [c] (☁ Record)) | At | X: ((220) - ((length of (join [c] (☁ Record))) * (13))) Y: [150]\nelse\n    Setup String | String: (join [p] (#PlayersOnline)) | At | X: ((220) - ((length of (#PlayersOnline)) * (13))) Y: [150]\nend\nshow\ngo to x: (0) y: (0)\nif <<<(Last Rise) > (Rise)> or <(Rise) < [0]>> or <(Mode) = [0]>> then\n    switch costume to (join [Screen ] (Mode))\nelse\n    switch costume to (screen + warning v)\nend\nset [last rise v] to (Rise)\n\nwhen flag clicked\nhide\n\nwhen I receive [menu v]\nforever\n    if <(Mode) = [1]> then\n        Setup String | String: (join [o] (Overall Kills)) | At | X: [50] Y: [150]\n    else\n        Setup String | String: (join [c] (☁ Record)) | At | X: [0] Y: [150]\n    end\nend\n\ndefine Setup String | String: (s) | At | X: (x) Y: (y)\nshow\nswitch costume to (join [s] (letter (1) of (s)))\ngo to x: (x) y: (y)\nset [# v] to [1]\nrepeat (length of (s))\n    create clone of (_myself_ v)\n    change [# v] by (1)\n    change x by (13)\n    switch costume to (join [s] (letter (#) of (s)))\nend\nhide\n\nwhen I start as a clone\nset size to (100) %\nshow\nwait (0) seconds\ndelete this clone\n\nwhen I receive [close menu v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [attacked v]\nswitch costume to (attacked v)\ncreate clone of (_myself_ v)\nswitch costume to (screen 1 v)\n\n@Particles\n\nwhen I receive [green flag v]\nhide\nset [clone v] to [0]\n\nwhen I receive [position v]\nif <(Clone) = [0 ]> then\n    if <(pick random (1) to (50)) = [50]> then\n        set [x v] to ((CamX) + (pick random (-500) to (500)))\n        set [y v] to ((-215) + (CamY))\n        create clone of (_myself_ v)\n    end\n    hide\nend\n\nwhen I start as a clone\nclear graphic effects\nset [ghost v] effect to (90)\nset [clone v] to [1]\nset size to (pick random (70) to (100)) %\nrepeat (315)\n    go to x: ((((((X) - (CamX)) * (0.9)) + (240)) mod (480)) - (240)) y: ((((((Y) - (CamY)) * (0.9)) + (180)) mod (360)) - (180))\n    change [y v] by (2)\n    show\n    go to [back v] layer\nend\ndelete this clone\n\nwhen I receive [menu v]\nhide\ndelete this clone\n\n@Chat\n\nwhen I receive [position v]\nif <(Chat Timer) > [150]> then\n    set [saying v] to [0]\nend\nchange [chat timer v] by (1)\nif <(Mode) = [1]> then\n    show\n    if <key (t v) pressed?> then\n        if <(TBlock) = [0]> then\n            set [chat v] to (((Chat) + (1)) mod (2))\n        end\n        set [tblock v] to [1]\n    else\n        set [tblock v] to [0]\n    end\n    if <(Chat) = [1]> then\n        change x by (((0) - (x position)) / (5))\n        change [ghost v] effect by (-10)\n        if <key (1 v) pressed?> then\n            set [saying v] to [1]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n        end\n        if <key (2 v) pressed?> then\n            set [saying v] to [2]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n        end\n        if <key (3 v) pressed?> then\n            set [saying v] to [3]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n            set [chat timer v] to [0]\n        end\n        if <key (4 v) pressed?> then\n            set [saying v] to [4]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n        end\n        if <key (5 v) pressed?> then\n            set [saying v] to [5]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n        end\n        if <key (6 v) pressed?> then\n            set [saying v] to [6]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n        end\n        if <key (7 v) pressed?> then\n            set [saying v] to [7]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n        end\n        if <key (8 v) pressed?> then\n            set [saying v] to [8]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n        end\n        if <key (9 v) pressed?> then\n            set [saying v] to [9]\n            set [chat v] to [0]\n            set [chat timer v] to [0]\n        end\n    else\n        change x by (((-300) - (x position)) / (5))\n        change [ghost v] effect by (10)\n    end\nelse\n    hide\nend\ngo to [front v] layer\n\nwhen flag clicked\nhide\nset [chat v] to [0]\nset [tblock v] to [0]\n\n@Intro\n\nwhen flag clicked\nerase all\nif <(Intro) = [1]> then\n    wait (1) seconds\n    reset timer\n    show\n    switch costume to (logo v)\n    start sound [Intro Sound v]\n    clear graphic effects\n    set size to (100) %\n    go to x: (0) y: (0)\n    Clone ID: [BG]\n    wait until <(timer) > [4]>\n    hide\n    set [intro v] to [0]\nend\n\ndefine Clone ID: (id)\nset [clondid v] to (id)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(ClondID) = [BG]> then\n    switch costume to (bg v)\n    go to [back v] layer\n    clear graphic effects\n    set [brightness v] effect to (80)\n    repeat (60)\n        set [brightness v] effect to (pick random (80) to (82))\n    end\n    repeat (100)\n        change [brightness v] effect by (-1.25)\n    end\n    wait until <(timer) > [6]>\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\ndelete this clone\n\n@TN\n\nwhen flag clicked\nforever\n    set [t v] to (timer)\n    hide\nend\n\nwhen [timer v] > (t)\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\n\n