Untitled
raw download clone
TEXT
views 15
,
size 8756 b
#心跳水立方 skript made by tony2100_YT
#加入遊戲
command /x join <text>:
    Trigger:
        if {stats.%player%} is "ingame":
            send "&C錯誤 // 你已經在遊戲內了" to player
        else:
            if arg-1 is "test":
                if {now.game.test} is not set:
                    if {count.test} is not set:
                        set {game.%player%} to "test"
                        set {stats.%player%} to "ingame"
                        teleport player to location at -9, 75, -165 in world "world"
                        set {count.test} to 1
                        execute console command "gamesay %{count.test}% %player% counttest"
                    else:
                        if {count.test} is 5:
                            send "&C錯誤 // 這場遊戲已經滿人了" to player
                            stop
                        if {count.test} is 4:
                            set {game.%player%} to "test"
                            set {stats.%player%} to "ingame"
                            teleport player to location at -9, 75, -165 in world "world"
                            set {count.test} to 5
                            execute console command "gamesay %{count.test}% %player% counttest"
                            execute console command "xstart test"
                        else:
                            set {game.%player%} to "test"
                            set {stats.%player%} to "ingame"
                            teleport player to location at -9, 75, -165 in world "world"
                            set {count.test} to {count.test}+1
                            execute console command "gamesay %{count.test}% %player% counttest"
                            stop
                        stop 
                else:
                    send "&C錯誤 // 這場遊戲已經開始" to player
            else:
                send "&c錯誤 // 使用方式: /x join <遊戲名稱>" to player

#遊戲格式區域廣播
#/gamesay <字串> <ID> <性質>

command /gamesay <text> <text> <text>:
    Permission: server.console
    executable by: console
    Trigger:
        if arg 3 is "counttest":
            loop all players:
                if {game.%loop-player%} is "test":
                    send "&a遊戲 // &c%arg-2% &e已加入 &e%{count.test}%&c/&e5" to loop-players
        if arg 3 is "leavetest":
            loop all players:
                if {game.%loop-player%} is "test":
                    send "&a遊戲 // &e%arg-2% &c已退出 &e%{count.test}%&c/&e5" to loop-players
        if arg 3 is "starttest":
            loop all players:
                if {game.%loop-player%} is "test":
                    send "&a遊戲 // %coloured arg-1%" to loop-players

#/gamesay <字串> <遊戲>
command /gamesay2 (<text>) <text>:
    Permission: server.console
    Trigger:
        loop all players:
            if {game.%loop-player%} is arg-2:
                send "%coloured arg-1%" to loop-players
        

#離開

command /xleave:
    Trigger:
        if {game.%player%} is "test":
            set {count.test} to {count.test}-1
            execute console command "gamesay %{count.test}% %player% leavetest"
            clear {stats.%player%}
            clear {game.%player%}
            teleport player to location at -9, 75, -180 in world "world"
            if {count.test} is 4:
                clear {now.game.test}
        else:
            send "&c錯誤 // 你不在任何一個遊戲內!" to player
            stop

#登出離開
on quit:
    if {game.%player%} is "test":
        set quit message to ""
        set {count.test} to {count.test}-1
        execute console command "gamesay %{count.test}% %player% leavetest"
        clear {stats.%player%}
        clear {game.%player%}
        teleport player to location at -9, 75, -180 in world "world"
        if {count.test} is 4:
            clear {now.game.test}


#開始

command /xstart <text>:
    Permission: server.console
    Trigger:
        if arg 1 is "test":
            if {count.test} is not 5:
                execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                clear {now.game.test}
            else:
                send "&e&lINFO // THE GAME [TEST] started" to console
                #遊戲狀態
                set {now.game.test} to true
                if {count.test} is not 5:
                    execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                    clear {now.game.test}
                else:
                    execute console command "gamesay2 (&a遊戲 // &e遊戲即將開始!) test"
                    wait 4 seconds
                    if {count.test} is not 5:
                        execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                        clear {now.game.test}
                    else:
                        execute console command "gamesay2 (&a遊戲 // &e&l遊戲即將在 &c&l5 &e&l秒後開始!) test"
                        if {count.test} is not 5:
                            execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                            clear {now.game.test}
                        else:
                            wait 1 second
                            execute console command "gamesay2 (&a遊戲 // &e&l遊戲即將在 &c&l4 &e&l秒後開始!) test"
                            if {count.test} is not 5:
                                execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                                clear {now.game.test}
                            else:
                                wait 1 second
                                execute console command "gamesay2 (&a遊戲 // &e&l遊戲即將在 &c&l3 &e&l秒後開始!) test"
                                if {count.test} is not 5:
                                    execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                                    clear {now.game.test}
                                else:
                                    wait 1 second
                                    execute console command "gamesay2 (&a遊戲 // &e&l遊戲即將在 &c&l2 &e&l秒後開始!) test"
                                    if {count.test} is not 5:
                                        execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                                        clear {now.game.test}
                                    else:
                                        wait 1 second
                                        execute console command "gamesay2 (&a遊戲 // &e&l遊戲即將在 &c&l1 &e&l秒後開始!) test"
                                        if {count.test} is not 5:
                                            execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                                            clear {now.game.test}
                                        else:
                                            wait 1 second
                                            if {count.test} is not 5:
                                                execute console command "gamesay2 (&a遊戲 // &c人數不足! 遊戲已被取消!) test"
                                                clear {now.game.test}
                                            else:
                                                execute console command "gamesay2 (&a遊戲 // &a&l遊戲開始!) test"
        else:
            send "&4ERROR :xstart錯誤"




#----------------------------------------------------------------------------------

#DEBUG工具

command /xdebug <text>:
    Permission: server.console
    Trigger:
        if arg 1 is "+":
            set {count.test} to {count.test}+1
            send "&AIT'S <%{count.test}%/5>" to player
        if arg 1 is "-":
            set {count.test} to {count.test}-1
            send "&AIT'S <%{count.test}%/5>" to player

command /xclear:
    Permission: server.console
    Trigger:
        clear {count.test}
        clear {stats.%player%}
        clear {game.%player%}
        clear {stats.%player%}
        clear {now.game.test}

command /xclear2:
    Permission: server.console
    Trigger:
        clear {stats.%player%}
        clear {game.%player%}
        clear {stats.%player%}
close fullscreen
Login or Register to edit or fork this paste. It's free.