mirricraft-skript/mirricraft-kitpvp.sk
Christer Warén ef9d3f2ede Update
2024-03-26 23:27:40 +02:00

240 lines
11 KiB
Plaintext

#--------------------------------------------------
#
# MIRRICRAFT
# by Christer Warén / Warén Group
#
#--------------------------------------------------
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's name%.map} is set:
if {kitpvp.%player's name%.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's name%.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's name%.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's name%.kit} is set:
if {kitpvp.%player's name%.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"]
if {kitpvp.%player's name%.kit} is "speedster":
format slot 14 of player with iron chestplate named "&fKitit" with lore "Vauhtihirmu" to close then run [execute player command "/kitpvp setkit"]
if {kitpvp.%player's name%.kit} is "archer":
format slot 14 of player with iron chestplate named "&fKitit" with lore "Jousimies" 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's name%.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's name%.map} and {kitpvp.%player's name%.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's name%.map} to "winter"
make player execute command "/kitpvp"
stop
if arg-2 is "nether":
set {kitpvp.%player's name%.map} to "nether"
make player execute command "/kitpvp"
stop
if arg-2 is "farm":
set {kitpvp.%player's name%.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 sword named "&fSotilas" to close then run [execute player command "/kitpvp setkit soldier"]
format slot 13 of player with gold boots named "&fVauhtihirmu" to close then run [execute player command "/kitpvp setkit speedster"]
format slot 15 of player with bow named "&fJousimies" to close then run [execute player command "/kitpvp setkit archer"]
stop
else:
if arg-2 is "soldier":
set {kitpvp.%player's name%.kit} to "soldier"
make player execute command "/kitpvp"
stop
if arg-2 is "speedster":
set {kitpvp.%player's name%.kit} to "speedster"
make player execute command "/kitpvp"
stop
if arg-2 is "archer":
set {kitpvp.%player's name%.kit} to "archer"
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's name%.kit} is set:
if {kitpvp.%player's name%.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 0 of player's inventory to 1 of iron sword
if {kitpvp.%player's name%.kit} is "speedster":
set player's helmet to gold helmet
set player's chestplate to gold chestplate
set player's leggings to gold leggings
set player's boots to gold boots
set the player's walk speed to 0.4
set slot 0 of player's inventory to 1 of gold sword
if {kitpvp.%player's name%.kit} is "archer":
set player's helmet to chainmail helmet
set player's chestplate to chainmail chestplate
set player's leggings to chainmail leggings
set player's boots to chainmail boots
set slot 0 of player's inventory to 1 of bow
set slot 9 of player's inventory to 25 of spectral arrow
else:
make player execute command "/kitpvp"
if {kitpvp.%player's name%.map} is set:
if {kitpvp.%player's name%.map} is "winter":
teleport player to location -48, 6, 264
else if {kitpvp.%player's name%.map} is "nether":
teleport player to location 73, 4, 269
else if {kitpvp.%player's name%.map} is "farm":
teleport player to location 57, 5, 357
else:
make player execute command "/kitpvp"
if {kitpvp.%player's name%.started} is not set:
heal the player
set {kitpvp.%player's name%.started} to true
stop
else if arg-1 is "end":
remove all items from player
clear {kitpvp.%player's name%.started}
teleport player to spawn of "%player's world%"
stop
else:
stop
stop
else:
stop
on join:
if player's world is "minigames":
teleport player to spawn of "%player's world%"
remove all items from player
set the player's walk speed to 0.2
set slot 7 of player's inventory to 1 of chest named "&fKitPVP"
stop
on respawn:
if player's world is "minigames":
set slot 7 of player's inventory to 1 of chest named "&fKitPVP"
stop
on death:
if victim's world is "minigames":
remove all items from victim
set the victim's walk speed to 0.2
clear {kitpvp.%victim%.started}
clear drops
on quit:
if player's world is "minigames":
remove all items from player
clear {kitpvp.%player's name%.started}
stop
on leftclick:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
make player execute command "/kitpvp"
cancel 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 event
wait 2 tick
on inventory click:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
cancel event
on drop:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
cancel event
on pickup:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
cancel event
on break:
if player's world is "minigames":
if {kitpvp.%player's name%.started} is set:
cancel event
on block damage:
if player's world is "minigames":
if {kitpvp.%player's name%.started} is set:
cancel event
on item damage:
if player's world is "minigames":
if {kitpvp.%player's name%.started} is set:
cancel event
on region exit:
if player's world is "minigames":
wait 1 tick
if "%event-region%" contains "minigames_kitpvp_":
remove all items from player
set the player's walk speed to 0.2
clear {kitpvp.%player's name%.started}
on hunger meter change:
if player's world is "minigames":
wait 1 tick
feed the player