I want to make a simple eggwars skript (more info below)

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

LyoxYT

Member
Oct 31, 2023
3
0
1
23
I want to make a simple eggwars skript (no idea stealing) that works like this:
When you type the command "/join eggwars" in chat you will be teleported to the world "eggwars" to the position 0 0 0, after the map have at least 2 players it will start a countdown from 30 to 0, after the countdown ends i want to divide the players to 4 teams and then teleports each player from each team to the spawn of the team he got into (Red: 10 10 10, Yellow: 20 20 20, Green 30 30 30 and Blue 40 40 40) and place a egg in the coordinates 0 -10 0.
If anyone could help me because i am starting and i am working on this big project.
 
Hey, this is what I just did in a hurry, it's not much, but it's enough for a base to bounce off of.
Code:
on load:
    set {green.tp} to location at 30, 30, 30 in world "eggwars"
    set {red.tp} to location at 10, 10, 10 in world "eggwars"
    set {yellow.tp} to location at 20, 20, 20 in world "eggwars"
    set {blue.tp} to location at 40, 40, 40 in world "eggwars"
    set {game} to false
    clear {green::*}
    clear {yellow::*}
    clear {red::*}
    clear {blue::*}
    clear {joined::*}
    add {green.tp}, {red.tp}, {yellow.tp} and {blue.tp} to {locs::*}

command /join eggwars:
    trigger:
        if {joined::*} does not contain player:
            if {game} is false:
                teleport player to location(0, 0, 0, world "eggwars")
                send "&aYou've joined the eggwars!" to player
                add player to {joined::*}
                if size of {joined::*} is more than 1:
                    loop 30 times:
                        if size of {joined::*} is more than 1:
                            broadcast "&aStart in %31 - loop-number%"
                            wait 1 second
                        else:
                            send "&cToo many players left during countdown!" to {joined::*}
                            stop
                    if size of {joined::*} is more than 1:
                        set {game} to true
                        if size of {joined::*} is 2:
                            loop 2 times:
                                set {_p} to random element out of {joined::*}
                                set {_l} to random element out of {locs::*}
                                teleport {_p} to {_l}
                                if location of {_p} is {red.tp}:
                                    if size of {red::*} is 0:
                                        add {_p} to {red::*}
                                    else if size of {green::*} is 0:
                                        add {_p} to {green::*}
                                    else if size of {yellow::*} is 0:
                                        add {_p} to {yellow::*}
                                    else if size of {blue::*} is 0:
                                        add {_p} to {blue::*}
                                else if location of {_p} is {green.tp}:
                                    if size of {green::*} is 0:
                                        add {_p} to {green::*}
                                    else if size of {red::*} is 0:
                                        add {_p} to {red::*}
                                    else if size of {yellow::*} is 0:
                                        add {_p} to {yellow::*}
                                    else if size of {blue::*} is 0:
                                        add {_p} to {blue::*}
                                else if location of {_p} is {yellow.tp}:
                                    if size of {yellow::*} is 0:
                                        add {_p} to {yellow::*}
                                    else if size of {red::*} is 0:
                                        add {_p} to {red::*}
                                    else if size of {green::*} is 0:
                                        add {_p} to {green::*}
                                    else if size of {blue::*} is 0:
                                        add {_p} to {blue::*}
                                else if location of {_p} is {blue.tp}:
                                    if size of {blue::*} is 0:
                                        add {_p} to {blue::*}
                                    else if size of {red::*} is 0:
                                        add {_p} to {red::*}
                                    else if size of {yellow::*} is 0:
                                        add {_p} to {yellow::*}
                                    else if size of {green::*} is 0:
                                        add {_p} to {green::*}
                                remove {_p} from {joined::*}
                                set block at location 0, -10, 0 in world "eggwars" to dragon egg
                        else if size of {joined::*} is 3:
                            loop 3 times:
                                set {_p} to random element out of {joined::*}
                                set {_l} to random element out of {locs::*}
                                teleport {_p} to {_l}
                                if location of {_p} is {red.tp}:
                                    if size of {red::*} is 0:
                                        add {_p} to {red::*}
                                    else if size of {green::*} is 0:
                                        add {_p} to {green::*}
                                    else if size of {yellow::*} is 0:
                                        add {_p} to {yellow::*}
                                    else if size of {blue::*} is 0:
                                        add {_p} to {blue::*}
                                else if location of {_p} is {green.tp}:
                                    if size of {green::*} is 0:
                                        add {_p} to {green::*}
                                    else if size of {red::*} is 0:
                                        add {_p} to {red::*}
                                    else if size of {yellow::*} is 0:
                                        add {_p} to {yellow::*}
                                    else if size of {blue::*} is 0:
                                        add {_p} to {blue::*}
                                else if location of {_p} is {yellow.tp}:
                                    if size of {yellow::*} is 0:
                                        add {_p} to {yellow::*}
                                    else if size of {red::*} is 0:
                                        add {_p} to {red::*}
                                    else if size of {green::*} is 0:
                                        add {_p} to {green::*}
                                    else if size of {blue::*} is 0:
                                        add {_p} to {blue::*}
                                else if location of {_p} is {blue.tp}:
                                    if size of {blue::*} is 0:
                                        add {_p} to {blue::*}
                                    else if size of {red::*} is 0:
                                        add {_p} to {red::*}
                                    else if size of {yellow::*} is 0:
                                        add {_p} to {yellow::*}
                                    else if size of {green::*} is 0:
                                        add {_p} to {green::*}
                                remove {_p} from {joined::*}
                                set block at location 0, -10, 0 in world "eggwars" to dragon egg
                        else if size of {joined::*} is more than 3:
                            loop 100 times:
                                set {_p} to random element out of {joined::*}
                                set {_l} to random element out of {locs::*}
                                teleport {_p} to {_l}
                                if location of {_p} is {red.tp}:
                                    add {_p} to {red::*}
                                else if location of {_p} is {green.tp}:
                                    add {_p} to {green::*}
                                else if location of {_p} is {yellow.tp}:
                                    add {_p} to {yellow::*}
                                else if location of {_p} is {blue.tp}:
                                    add {_p} to {blue::*}
                                remove {_p} from {joined::*}
                                set block at location 0, -10, 0 in world "eggwars" to dragon egg

on quit:
    if {joined::*} contains player:
        remove player from {joined::*}