Cloud Platformer base v2.1.7b


@Stage\n\nwhen flag clicked\nswitch backdrop to (level 1 v)\nif <<(current [hour v]) > [17]> or <(current [hour v]) < [6]>> then\n    set [brightness v] to [-50]\nelse\n    set [brightness v] to [0]\nend\nforever\n    if <<(current [hour v]) > [17]> or <(current [hour v]) < [6]>> then\n        repeat until <(Brightness) = [-50]>\n            change [brightness v] by (((-50) - (Brightness)) / (2.5))\n            set [brightness v] effect to ((Brightness) * (2))\n        end\n        set [brightness v] to [-50]\n        set [brightness v] effect to ((Brightness) * (2))\n        wait until <not <<(current [hour v]) > [17]> or <(current [hour v]) < [6]>>>\n        stop all sounds\n    else\n        repeat until <(Brightness) = [0]>\n            change [brightness v] by (((0) - (Brightness)) / (2.5))\n            set [brightness v] effect to ((Brightness) * (2))\n        end\n        set [brightness v] to [0]\n        set [brightness v] effect to ((Brightness) * (2))\n        wait until <<(current [hour v]) > [17]> or <(current [hour v]) < [6]>>\n        set [brightness v] effect to ((Brightness) * (2))\n        stop all sounds\n    end\n    set [brightness v] effect to ((Brightness) * (2))\nend\n\nwhen flag clicked\nif <(On?) = [True]> then\n    set volume to (100) %\nelse\n    set volume to (0) %\nend\nforever\n    play sound [Loading v] until done\nend\n\nwhen [v v] key pressed\nif <(volume) = [100]> then\n    set volume to (0) %\n    set [on? v] to [False]\nelse\n    set volume to (100) %\n    set [on? v] to [True]\nend\n\nwhen I receive [change v]\nif <(volume) = [100]> then\n    set volume to (0) %\n    set [on? v] to [False]\nelse\n    set volume to (100) %\n    set [on? v] to [True]\nend\n\nwhen I receive [change location v]\nbroadcast (Hide v) and wait\nbroadcast (Show v) and wait\n\nwhen I receive [play v]\nif <(On?) = [True]> then\n    repeat (10)\n        change volume by (((0) - (volume)) / (2))\n    end\nelse\n    set volume to (0) %\nend\nstop [other scripts in sprite v]\nbroadcast (Loop v)\nif <(On?) = [True]> then\n    set volume to (100) %\nelse\n    set volume to (0) %\nend\nforever\n    if <<(current [hour v]) > [17]> or <(current [hour v]) < [6]>> then\n        play sound [Beach \(Underwater\) v] until done\n    else\n        play sound [Beach \(Overworld\) v] until done\n    end\nend\n\nwhen I receive [loop v]\nforever\n    if <<(current [hour v]) > [17]> or <(current [hour v]) < [6]>> then\n        repeat until <(Brightness) = [-50]>\n            change [brightness v] by (((-50) - (Brightness)) / (2.5))\n            set [brightness v] effect to ((Brightness) * (2))\n        end\n        set [brightness v] to [-50]\n        set [brightness v] effect to ((Brightness) * (2))\n        wait until <not <<(current [hour v]) > [17]> or <(current [hour v]) < [6]>>>\n        stop all sounds\n    else\n        repeat until <(Brightness) = [0]>\n            change [brightness v] by (((0) - (Brightness)) / (2.5))\n            set [brightness v] effect to ((Brightness) * (2))\n        end\n        set [brightness v] to [0]\n        set [brightness v] effect to ((Brightness) * (2))\n        wait until <<(current [hour v]) > [17]> or <(current [hour v]) < [6]>>\n        set [brightness v] effect to ((Brightness) * (2))\n        stop all sounds\n    end\n    set [brightness v] effect to ((Brightness) * (2))\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (0)\nswitch costume to (resizer v)\nset size to (100) %\nswitch costume to (thumbnail v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    go to [front v] layer\n    change y by (((1) - (y position)) / (-1.5))\nend\nhide\n\ngo to x: (0) y: (0)\nswitch costume to (resizer v)\nset size to (100) %\nswitch costume to (thumbnail v)\nclear graphic effects\ngo to [front v] layer\nshow\nhide variable [players v]\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 [id v] to [0]\ndelete all of [players v]\ndelete all of [slots v]\nrepeat (10)\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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [0]> then\n        set [id 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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 (ID)\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 <(ID) = [1]>> then\n    load player [1]\nend\nif <not <(ID) = [2]>> then\n    load player [2]\nend\nif <not <(ID) = [3]>> then\n    load player [3]\nend\nif <not <(ID) = [4]>> then\n    load player [4]\nend\nif <not <(ID) = [5]>> then\n    load player [5]\nend\nif <not <(ID) = [6]>> then\n    load player [6]\nend\nif <not <(ID) = [7]>> then\n    load player [7]\nend\nif <not <(ID) = [8]>> then\n    load player [8]\nend\nif <not <(ID) = [9]>> then\n    load player [9]\nend\nif <not <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [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 <(ID) = [3]>> then\n        check player [3]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [4]>> then\n        check player [4]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [5]>> then\n        check player [5]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [6]>> then\n        check player [6]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [7]>> then\n        check player [7]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [8]>> then\n        check player [8]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [1]>> then\n        check player [1]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [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 [id v] to [0]\nconnect\nsay []\nbroadcast (Load done v)\nif <(ID) = [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\nwhen flag clicked\nbroadcast (connect & start v)\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [9]>> then\n        check player [9]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <not <(ID) = [10]>> then\n        check player [10]\n    end\nend\n\n@Intro\n\nwhen flag clicked\nhide\nset size to (100) %\nbroadcast (Intro v)\nclear graphic effects\nset [intro set 2 v] to [0]\nset [set v] to [2]\ncreate clone of (_myself_ v)\nset [set v] to [-1]\nwait (0.25) seconds\nset [set v] to [0]\nswitch costume to (logo v)\ncreate clone of (_myself_ v)\nset [set v] to [-1]\nbroadcast (Show logo v)\n\nwhen I start as a clone\nclear graphic effects\nset size to (100) %\nif <(set) = [3]> then\n    switch costume to (fade v)\n    go to x: (0) y: (0)\n    set [brightness v] effect to (-100)\n    show\nelse\n    if <(set) = [2]> then\n        switch costume to (fade v)\n        go to x: (0) y: (0)\n        show\n    else\n        if <(set) = [1]> then\n            clear graphic effects\n            show\n            go to [front v] layer\n            go to x: (0) y: (0)\n            switch costume to (presents v)\n        else\n            if <(set) = [0]> then\n                switch costume to (logo v)\n                go to [front v] layer\n                show\n                go to x: (0) y: (40)\n            else\n                delete this clone\n            end\n        end\n    end\nend\n\nwhen I receive [load done v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ndelete this clone\n\nwhen I start as a clone\nif <(set) = [1]> then\n    set [brightness v] effect to (0)\n    switch costume to (presents v)\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    show\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (0.1) seconds\n    start sound [Logo v]\n    repeat (5)\n        change [brightness v] effect by (2)\n    end\n    repeat (5)\n        change [brightness v] effect by (-2)\n    end\n    wait ((1.51) - ((1) / (3))) seconds\n    broadcast (Start v)\nend\nif <(set) = [0]> then\n    go to x: (0) y: (1000)\n    set [ghost v] effect to (100)\n    set [y v] to [0]\n    repeat until <<(y position) < [2]> and <(round (Y)) = [0]>>\n        change [ghost v] effect by (-10)\n        change [y v] by (-1.2)\n        if <(y position) < [0]> then\n            set volume to (100) %\n            start sound [Boing v]\n            set [y v] to ((Y) * (-0.3))\n            change y by (Y)\n        end\n        change y by (Y)\n    end\n    set [intro set 2 v] to [1]\nend\n\nwhen I start as a clone\nif <(set) = [2]> then\n    wait until <(Intro set 2) = [1]>\n    set [set v] to [1]\n    create clone of (_myself_ v)\n    set [set v] to [2]\nend\n\n@Player\n\nwhen flag clicked\nforever\n    set [brightness v] effect to (Brightness)\nend\n\ndefine Platformer script (jump height) (gravity) (friction) (running speed)\nswitch costume to (hitbox v)\nif <<key (right arrow v) pressed?> or <<(R) = [1]> or <(SwipeState) = [right]>>> then\n    change [xvel v] by (running speed)\n    point in direction (90)\nend\nif <<key (left arrow v) pressed?> or <<(L) = [1]> or <(SwipeState) = [left]>>> then\n    change [xvel v] by ((running speed) * (-1))\n    point in direction (-90)\nend\nset [xvel v] to ((Xvel) * (friction))\nchange x by (Xvel)\nif <<touching (level floor v)?> or <touching (level scene 1 v)?>> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <<touching (level floor v)?> or <touching (level scene 1 v)?>>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <<touching (level floor v)?> or <touching (level scene 1 v)?>> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (Xvel) ) )\n            if <<touching (level floor v)?> or <touching (level scene 1 v)?>> then\n                change x by ((([abs v] of (Xvel) ) / (Xvel)) * (-1))\n            end\n        end\n        set [xvel v] to [0]\n    end\nend\nchange y by (Yvel)\nif <<touching (level floor v)?> or <touching (level scene 1 v)?>> then\n    repeat ([ceiling v] of ([abs v] of (Yvel) ) )\n        if <<touching (level floor v)?> or <touching (level scene 1 v)?>> then\n            change y by ((([abs v] of (Yvel) ) / (Yvel)) * (-1))\n        end\n    end\n    if <<(([abs v] of (Yvel) ) / (Yvel)) = [-1]> and <<key (up arrow v) pressed?> or <<(J) = [1]> or <(SwipeState) = [up]>>>> then\n        set [yvel v] to (jump height)\n    else\n        set [yvel v] to [0]\n    end\nelse\n    change [yvel v] by (-1)\nend\nswitch costume to (ID)\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nif <not <(ID) = [0]>> then\n    set [location v] to [1]\n    forever\n        if <(x position) > [230]> then\n            go to x: (0) y: (-129)\n            if <(Location) = (Max locations)> then\n                set [location v] to [1]\n            else\n                change [location v] by (1)\n            end\n            broadcast (Change location v)\n        end\n        if <(x position) < [-230]> then\n            go to x: (0) y: (-129)\n            if <(Location) = [1]> then\n                set [location v] to (Max locations)\n            else\n                change [location v] by (-1)\n            end\n            broadcast (Change location v)\n        end\n        wait (1) seconds\n    end\nelse\n    forever\n        if <key (right arrow v) pressed?> then\n            if <(Location) = (Max locations)> then\n                set [location v] to [1]\n            else\n                change [location v] by (1)\n            end\n            broadcast (Change location v) and wait\n        end\n        if <key (left arrow v) pressed?> then\n            if <(Location) = [1]> then\n                set [location v] to (Max locations)\n            else\n                change [location v] by (-1)\n            end\n            broadcast (Change location v) and wait\n        end\n    end\nend\n\nwhen I receive [play v]\nif <not <(ID) = [0]>> then\n    set language to (en v)::tts\n    set voice to (tenor v)::tts\n    speak (join (join (username) [, welcome to Cloud Platformer base! Your player ID is: ]) (ID))::tts\nend\n\nwhen I receive [play v]\nif <not <(ID) = [0]>> then\n    set size to (40) %\n    show\n    set [player_shown? v] to [1]\n    point in direction (90)\n    go to x: (0) y: (-129)\n    forever\n        switch costume to (ID)\n        Platformer script [12] [-1] [0.7] [2]\n        set [player_x v] to (x position)\n        set [player_y v] to (y position)\n    end\nend\n\n@Players\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 (40) %\ngo to x: (0) y: (-130)\npoint in direction (90)\nset [current_x v] to [0]\nset [current_y v] to [-130]\nif <not <(pID) = (ID)>> 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: (item (1) of [data v]) y: (item (2) of [data v])\n    forever\n        set [brightness v] effect to (Brightness)\n        switch costume to (pID)\n        get data of player (pID)\n        change [current_x v] by (((item (1) of [data v]) - (x position)) / (3))\n        change [current_y v] by (((item (2) of [data v]) - (y position)) / (3))\n        go to x: (current_x) y: (current_y)\n        if <<(item (5) of [data v]) = [1]> and <<(item (6) of [data v]) = [1]> and <(item (7) of [data v]) = (Location)>>> then\n            show\n            think (item (4) of [data v])\n            if <(((480) + (item (1) of [data v])) - ((480) + (x position))) > [0]> then\n                point in direction (90)\n            else\n                if <(((480) + (item (1) of [data v])) - ((480) + (x position))) < [0]> then\n                    point in direction (-90)\n                end\n            end\n        else\n            point in direction (90)\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nif <not <(pID) = (ID)>> 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            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@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@Level floor\n\nwhen flag clicked\nforever\n    set [brightness v] effect to (Brightness)\nend\n\n@Level scene 1\n\nwhen flag clicked\nforever\n    set [brightness v] effect to (Brightness)\nend\n\nwhen I receive [show v]\nswitch costume to (Location)\nshow\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\n\nwhen I receive [hide v]\nset [ghost v] effect to (0)\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nhide\n\nwhen flag clicked\nshow\nCheck\n\ndefine Check\nset [max locations v] to [1]\nswitch costume to (level 1 v)\nnext costume\nrepeat until <(costume [number v]) = [1]>\n    change [max locations v] by (1)\n    next costume\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        broadcast (1 v)\n    else\n        if <(costume [number v]) = [2]> then\n            broadcast (2 v)\n        else\n            if <(costume [number v]) = [3]> then\n                broadcast (3 v)\n            else\n                if <(costume [number v]) = [4]> then\n                    broadcast (4 v)\n                else\n                    if <(costume [number v]) = [5]> then\n                        broadcast (5 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Next LVL\n\nwhen I receive [play v]\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [1 v]\nswitch costume to (costume1 v)\n\nwhen I receive [2 v]\nswitch costume to (costume2 v)\n\nwhen I receive [4 v]\nswitch costume to (costume4 v)\n\nwhen I receive [3 v]\nswitch costume to (costume3 v)\n\nwhen I receive [5 v]\nswitch costume to (costume5 v)\n\nwhen I receive [show v]\nshow\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\n\nwhen I receive [hide v]\nset [ghost v] effect to (0)\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nhide\n\nwhen flag clicked\nforever\n    set [brightness v] effect to (Brightness)\nend\n\n@Clouds\n\nwhen I start as a clone\nif <not <(Brightness) = [-50]>> then\n    clear graphic effects\n    show\n    go to x: (-2000) y: (pick random (120) to (170))\n    set [speed v] to (pick random (0.25) to (1))\n    switch costume to (pick random (1) to (4))\n    forever\n        change x by (Speed)\n        set [brightness v] effect to ((Brightness) * (1.75))\n        if <(x position) > [300]> then\n            hide\n            delete this clone\n        end\n    end\nelse\n    delete this clone\nend\n\nwhen flag clicked\nforever\n    if <(Brightness) = [0]> then\n        create clone of (_myself_ v)\n        wait (pick random (15) to (30)) seconds\n    end\nend\n\n@Joystick Engine\n\ndefine Get Direction From x: (x2) y: (y2) To x: (x) y: (y)\nset [dir v] to (((90) - ([atan v] of (((y) - (y2)) / ((x) - (x2))) )) + (<((x) - (x2)) < [0]> * (180)))\n\ndefine Joystick at x: (x) y: (y) Size: (size)\nbroadcast (Delete Joystick Clones v) and wait\nswitch costume to (joy v)\nset size to (size) %\nshow\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [delete joystick clones v]\nrepeat (5)\n    delete this clone\nend\nhide\n\nwhen I start as a clone\nswitch costume to (stick v)\nset size to (([size v] of [joystick engine v]) / (2)) %\nforever\n    go to x: ([x position v] of [joystick engine v]) y: ([y position v] of [joystick engine v])\n    set [touching? v] to [0]\n    wait until <mouse down?>\n    if <(In there?) = [True]> then\n        set [touching? v] to [1]\n        repeat until <not <mouse down?>>\n            go to x: (mouse x) y: (mouse y)\n            Get Direction From x: ([x position v] of [joystick engine v]) y: ([y position v] of [joystick engine v]) To x: (x position) y: (y position)\n            change x by (([sin v] of (Dir) ) * (2))\n            change y by (([cos v] of (Dir) ) * (2))\n            if <not <touching (joystick engine v)?>> then\n                go to x: (([x position v] of [joystick engine v]) + (([sin v] of (Dir) ) * ((size) * (0.3)))) y: (([y position v] of [joystick engine v]) + (([cos v] of (Dir) ) * ((size) * (0.3))))\n            end\n            change x by ((([sin v] of (Dir) ) * (2)) * (-1))\n            change y by ((([cos v] of (Dir) ) * (2)) * (-1))\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    show\n    set [ghost v] effect to ((GhostEffect) - (5))\n    go to [front v] layer\nend\n\nwhen I receive [play v]\nif <not <(ID) = [0]>> then\n    set [ghosteffect v] to [90]\n    set [in there? v] to [False]\n    Joystick at x: [-180] y: [-130] Size: [300]\n    forever\n        switch costume to (joy v)\n        if <<(distance to [mouse-pointer v]) < ((size) / (5))> or <(Touching?) = [1]>> then\n            change [ghosteffect v] by (((20) - (GhostEffect)) / (2))\n            set [in there? v] to [True]\n        else\n            change [ghosteffect v] by (((90) - (GhostEffect)) / (2))\n            set [in there? v] to [False]\n        end\n        set [ghost v] effect to (GhostEffect)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Touching?) = [1]> then\n        set [in? v] to [True]\n        if <(([sin v] of (Dir) ) * ((distance to [joystick engine v]) / ((size) / (20)))) > [0]> then\n            set [r v] to [1]\n        else\n            set [r v] to [0]\n        end\n        if <(([sin v] of (Dir) ) * ((distance to [joystick engine v]) / ((size) / (20)))) < [0]> then\n            set [l v] to [1]\n        else\n            set [l v] to [0]\n        end\n        if <(([cos v] of (Dir) ) * ((distance to [joystick engine v]) / ((size) / (20)))) > [3]> then\n            set [j v] to [1]\n        else\n            set [j v] to [0]\n        end\n    else\n        set [r v] to [0]\n        set [l v] to [0]\n        set [j v] to [0]\n        set [in? v] to [False]\n    end\nend\n\nwhen flag clicked\nhide\n\n@Mute button\n\nwhen flag clicked\ngo to x: (203) y: (-160)\nhide\n\nwhen this sprite clicked\nwait until <not <mouse down?>>\nif <touching (mouse-pointer v)?> then\n    broadcast (Change v) and wait\n    if <(On?) = [True]> then\n        switch costume to (mute off v)\n    else\n        switch costume to (mute on v)\n    end\nend\n\nwhen I receive [play v]\nset [ghost v] to [200]\nset [ghost v] effect to (Ghost)\nshow\nforever\n    if <<<touching (mouse-pointer v)?> and <mouse down?>> or <key (v v) pressed?>> then\n        change [ghost v] by (((0) - (Ghost)) / (2))\n    else\n        change [ghost v] by (((50) - (Ghost)) / (2))\n    end\n    set [ghost v] effect to (Ghost)\n    if <(On?) = [True]> then\n        switch costume to (mute off v)\n    else\n        switch costume to (mute on v)\n    end\nend\n\n@SWIPE ENGINE by noyco\n\nwhen flag clicked\nset [touching? v] to [False]\nforever\n    go to (mouse-pointer v)\n    if <<mouse down?> and <not <<touching (joystick engine v)?> or <(In?) = [True]>>>> then\n        set [oldx v] to (mouse x)\n        set [oldy v] to (mouse y)\n        wait (0.01) seconds\n        if <((OldY) + (20)) < (mouse y)> then\n            set [swipestate v] to [up]\n        end\n        if <((OldY) - (20)) > (mouse y)> then\n            set [swipestate v] to [down]\n        end\n        if <((OldX) + (20)) < (mouse x)> then\n            set [swipestate v] to [right]\n        end\n        if <((OldX) - (20)) > (mouse x)> then\n            set [swipestate v] to [left]\n        end\n    else\n        set [swipestate v] to [none]\n    end\nend\n\nwhen flag clicked\nforever\n    if <mouse down?> then\n        set [swipe speed v] to (([abs v] of ((OldY\(2\)) - (mouse y)) ) + ([abs v] of ((OldX\(2\)) - (mouse x)) ))\n    else\n        set [swipe speed v] to [0]\n    end\n    set [oldx\(2\) v] to (mouse x)\n    set [oldy\(2\) v] to (mouse y)\nend\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]\nplay sound [Join v] until done\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]\nplay sound [Left v] until done\nset language to (en v)::tts\nset voice to (tenor v)::tts\nspeak [A player has left the game.]::tts\n\nwhen I receive [playing alone v]\nstop [other scripts in sprite v]\nswitch costume to (alone 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 [found active game v]\nstop [other scripts in sprite v]\nswitch costume to (someone is in! 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 [spectator mode v]\nstop [other scripts in sprite v]\nswitch costume to (spectating 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\n@Screen\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\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)\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nswitch costume to (game full! v)\nset [brightness v] effect to (100)\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (2) seconds\nbroadcast (Spectator Mode v)\n\n