mirricraft-skript/mirricraft-kitpvp.sk
Christer Warén e1eb3e0d7c Update
2020-10-28 01:58:38 +02:00

189 lines
8.3 KiB
Plaintext

# --- KitPVP ---
command /kitpvp [<string>] [<string>]:
description: Spawn
executable by: players
trigger:
if player's world is "minigames":
if arg-1 is not set:
wait 2 tick
open chest inventory with 4 row named "KitPVP" to player
wait 2 tick
loop integers between 0 and 35:
format slot loop-integer of player with gray stained glass pane named "&7" to be unstealable
if {kitpvp.%player%.map} is set:
if {kitpvp.%player%.map} is "winter":
format slot 12 of player with compass named "&fKartta" with lore "Talvi" to close then run [execute player command "/kitpvp setmap"]
if {kitpvp.%player%.map} is "nether":
format slot 12 of player with compass named "&fKartta" with lore "Horna" to close then run [execute player command "/kitpvp setmap"]
if {kitpvp.%player%.map} is "farm":
format slot 12 of player with compass named "&fKartta" with lore "Farmi" to close then run [execute player command "/kitpvp setmap"]
else:
format slot 12 of player with compass named "&fKartta" to close then run [execute player command "/kitpvp setmap"]
if {kitpvp.%player%.kit} is set:
if {kitpvp.%player%.kit} is "soldier":
format slot 14 of player with iron chestplate named "&fKitit" with lore "Sotilas" to close then run [execute player command "/kitpvp setkit"]
else:
format slot 14 of player with iron chestplate named "&fKitit" to close then run [execute player command "/kitpvp setkit"]
if {kitpvp.%player%.started} is set:
format slot 27 of player with barrier named "&fLopeta" to close then run [execute player command "/kitpvp end"]
else:
if {kitpvp.%player%.map} and {kitpvp.%player%.kit} is set:
format slot 35 of player with nether star named "&fAloita" to close then run [execute player command "/kitpvp start"]
stop
else:
if arg-1 is "setmap":
if arg-2 is not set:
wait 2 tick
open chest inventory with 4 row named "KitPVP - Valitse kartta" to player
wait 2 tick
loop integers between 0 and 35:
format slot loop-integer of player with gray stained glass pane named "&7" to be unstealable
format slot 11 of player with snow block named "&fTalvi" to close then run [execute player command "/kitpvp setmap winter"]
format slot 13 of player with netherrack named "&fHorna" to close then run [execute player command "/kitpvp setmap nether"]
format slot 15 of player with hay bale named "&fFarmi" to close then run [execute player command "/kitpvp setmap farm"]
else:
if arg-2 is "winter":
set {kitpvp.%player%.map} to "winter"
make player execute command "/kitpvp"
stop
if arg-2 is "nether":
set {kitpvp.%player%.map} to "nether"
make player execute command "/kitpvp"
stop
if arg-2 is "farm":
set {kitpvp.%player%.map} to "farm"
make player execute command "/kitpvp"
stop
stop
else if arg-1 is "setkit":
if arg-2 is not set:
wait 2 tick
open chest inventory with 4 row named "KitPVP - Valitse kitti" to player
wait 2 tick
loop integers between 0 and 35:
format slot loop-integer of player with gray stained glass pane named "&7" to be unstealable
format slot 11 of player with iron helmet named "&fSotilas" to close then run [execute player command "/kitpvp setkit soldier"]
#format slot 13 of player with netherrack named "&fHorna" to close then run [execute player command "/kitpvp setmap nether"]
#format slot 15 of player with hay bale named "&fFarmi" to close then run [execute player command "/kitpvp setmap farm"]
stop
else:
if arg-2 is "soldier":
set {kitpvp.%player%.kit} to "soldier"
make player execute command "/kitpvp"
stop
stop
else if arg-1 is "start":
set gamemode of player to Survival
remove all items from player
if {kitpvp.%player%.kit} is set:
if {kitpvp.%player%.kit} is "soldier":
set player's helmet to iron helmet
set player's chestplate to iron chestplate
set player's leggings to iron leggings
set player's boots to iron boots
set slot 1 of player's inventory to 1 of iron sword
else:
make player execute command "/kitpvp"
if {kitpvp.%player%.map} is set:
if {kitpvp.%player%.map} is "winter":
teleport player to location -48, 6, 264
else if {kitpvp.%player%.map} is "nether":
teleport player to location 73, 4, 269
else if {kitpvp.%player%.map} is "farm":
teleport player to location 57, 4, 357
else:
make player execute command "/kitpvp"
if {kitpvp.%player%.started} is not set:
heal the player
feed the player
set {kitpvp.%player%.started} to true
stop
else if arg-1 is "end":
remove all items from player
clear {kitpvp.%player%.started}
teleport player to world "%player's world%"
stop
else:
stop
stop
else:
stop
on join:
if player's world is "minigames":
teleport player to world "%player's world%"
remove all items from player
set slot 0 of player's inventory to 1 of chest named "&fKitPVP"
stop
on respawn:
if player's world is "minigames":
set slot 0 of player's inventory to 1 of chest named "&fKitPVP"
stop
on quit:
if player's world is "minigames":
remove all items from player
clear {kitpvp.%player%.started}
stop
on leftclick:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
make player execute command "/kitpvp"
cancel the event
wait 2 tick
on rightclick:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
make player execute command "/kitpvp"
cancel the event
wait 2 tick
on inventory click:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
cancel the event
on drop:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
cancel the event
on pickup:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
delete event-entity
on death:
if player's world is "minigames":
clear drops
on region exit:
if player's world is "minigames":
wait 1 tick
if "%event-region%" contains "minigames_kitpvp_":
remove all items from player
clear {kitpvp.%player%.started}
on hunger meter change:
if player's world is "minigames":
wait 1 tick
feed the player