Minigame

  • 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!

Status
Not open for further replies.

PlesCZ

Member
Feb 12, 2017
3
0
0
21
I did a mini-game through a script. I create a new arena and then I want to join it (/example join name) and write to me that I'm in the game. Do not you know what?
The chat will say, in czech "Již jsi ve hře."

code_language.skript:
        if arg 1 is "join":
            if arg 2 is set:
                if {SUMO::Arena::%player%::INGAME} is false:
                    if {SUMO::Arena::%arg 2%} is set:
                        if {SUMO::Arena::%arg 2%::STATUS} is "&aČekání":
                            if {SUMO::Arena::%arg 2%::PLAYERS} is 0 or 1:
                                set {SUMO::Arena::%player%::BACK} to player's location
                                add player to {SUMO::Arena::%arg 2%::PLAYERS::*}
                                add 1 to {SUMO::Arena::%arg 2%::PLAYERS}
                                set {SUMO::Arena::%player%::Arena} to arg 2
                                invoke "save-inv" from player
                                wait 1 ticks
                                clear player's inventory
                                set {SUMO::Arena::%player%::INGAME} to true
                                set player's hunger to 20
                                set player's health to 20
                                play raw sound "note.pling" at player with pitch 1 volume 0.1
                                set player's game mode to survival
                                remove invisibility and speed and haste and regeneration and strength from player
                                teleport player to {SUMO::Arena::%arg 2%::LOBBY}
                                send "{@p} &a%player% &7se pripojil do hry. &8[&a%{SUMO::Arena::%arg 2%::PLAYERS}%&7/&a2&8]" to {SUMO::Arena::%arg 2%::PLAYERS::*}
                                set slot 8 of player's inventory to magma cream named "&cOdpojit ze hry!"
                                if {SUMO::Arena::%arg 2%::PLAYERS} is 2:
                                    set {SUMO::Arena::%arg 2%::STATUS} to "&2Startuje"
                                    set {_x} to 10
                                    set level of {SUMO::Arena::%arg 2%::PLAYERS::*} to 10
                                    send "{@p} &aHra startuje za &6&l10 sekund." to {SUMO::Arena::%arg 2%::PLAYERS::*}
                                    loop 10 times:
                                        if {SUMO::Arena::%arg 2%::PLAYERS} is 2:
                                            play raw sound "note.pling" at {SUMO::Arena::%arg 2%::PLAYERS::*} with pitch 1 volume 0.1
                                            set level of {SUMO::Arena::%arg 2%::PLAYERS::*} to {_x}
                                            remove 1 from {_x}
                                            wait 1 seconds
                                        else:
                                            send "{@p} &cOdpočet byl zrušen, protože se hráč odpojil z arény." to {SUMO::Arena::%arg 2%::PLAYERS::*}
                                            set {SUMO::Arena::%arg 2%::STATUS} to "&aČekání"
                                            set level of {SUMO::Arena::%arg 2%::PLAYERS::*} to 0
                                            stop trigger
                                    set {SUMO::Arena::%arg 2%::STATUS} to "&4&lVe hře"
                                    play raw sound "mob.enderdragon.growl" at {SUMO::Arena::%arg 2%::PLAYERS::*} with pitch 1 volume 0.5
                                    add 1 to {SUMO::Arena::%player%::GAMEPLAYED}
                                    send "{@p} &6Hra začla, hodně štěstí." to {SUMO::Arena::%arg 2%::PLAYERS::*}
                                    clear player's inventory
                                    wait 1 seconds
                                    loop {SUMO::Arena::%arg 2%::PLAYERS::*}:
                                        set slot 0 of loop-value to stick of knockback 1
                                    loop {SUMO::Arena::%arg 2%::PLAYERS::*}:
                                        add 1 to {_spawn}
                                        teleport loop-value to {SUMO::Arena::%arg 2%::SPAWN%{_spawn}%}
                                    set {SUMO::Arena::%arg 2%::PVP} to true
                            else:
                                send "{@p} &cTato aréna je plně obsazena!"
                        else:
                            send "{@p} &cTato aréna je: %{SUMO::Arena::%arg 2%::STATUS}%"
                    else:
                        send "{@p} &cTato aréna neexistuje: &6&l%arg 2%"
                else:
                    send "{@p} &cJiž jsi ve hře."
            else:
                send "{@p} &cProsím napiš jméno arény."
 
Status
Not open for further replies.