mirricraft-skript/mirricraft-kitpvp.sk

240 lines
11 KiB
Plaintext
Raw Normal View History

2023-04-26 14:44:54 +00:00
#--------------------------------------------------
#
# MIRRICRAFT
# by Christer Warén / Warén Group
#
#--------------------------------------------------
2020-10-24 07:10:45 +00:00
command /kitpvp [<string>] [<string>]:
2020-10-24 07:03:58 +00:00
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":
2020-10-24 07:29:45 +00:00
format slot 12 of player with compass named "&fKartta" with lore "Talvi" to close then run [execute player command "/kitpvp setmap"]
2020-10-24 07:03:58 +00:00
if {kitpvp.%player%.map} is "nether":
2020-10-24 07:29:45 +00:00
format slot 12 of player with compass named "&fKartta" with lore "Horna" to close then run [execute player command "/kitpvp setmap"]
2020-10-24 07:03:58 +00:00
if {kitpvp.%player%.map} is "farm":
2020-10-24 07:29:45 +00:00
format slot 12 of player with compass named "&fKartta" with lore "Farmi" to close then run [execute player command "/kitpvp setmap"]
2020-10-24 07:03:58 +00:00
else:
2020-10-24 07:29:45 +00:00
format slot 12 of player with compass named "&fKartta" to close then run [execute player command "/kitpvp setmap"]
2020-10-24 07:03:58 +00:00
if {kitpvp.%player%.kit} is set:
if {kitpvp.%player%.kit} is "soldier":
2020-10-24 07:29:45 +00:00
format slot 14 of player with iron chestplate named "&fKitit" with lore "Sotilas" to close then run [execute player command "/kitpvp setkit"]
2020-10-28 00:34:11 +00:00
if {kitpvp.%player%.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"]
2020-10-28 00:55:33 +00:00
if {kitpvp.%player%.kit} is "archer":
2020-10-28 00:51:41 +00:00
format slot 14 of player with iron chestplate named "&fKitit" with lore "Jousimies" to close then run [execute player command "/kitpvp setkit"]
2020-10-24 07:03:58 +00:00
else:
2020-10-24 07:29:45 +00:00
format slot 14 of player with iron chestplate named "&fKitit" to close then run [execute player command "/kitpvp setkit"]
2020-10-24 07:03:58 +00:00
2020-10-24 09:08:29 +00:00
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"]
2020-10-24 07:03:58 +00:00
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"]
2020-10-24 09:08:29 +00:00
format slot 15 of player with hay bale named "&fFarmi" to close then run [execute player command "/kitpvp setmap farm"]
2020-10-24 07:03:58 +00:00
else:
if arg-2 is "winter":
set {kitpvp.%player%.map} to "winter"
2020-10-24 09:08:29 +00:00
make player execute command "/kitpvp"
2020-10-24 07:03:58 +00:00
stop
if arg-2 is "nether":
set {kitpvp.%player%.map} to "nether"
2020-10-24 09:08:29 +00:00
make player execute command "/kitpvp"
2020-10-24 07:03:58 +00:00
stop
if arg-2 is "farm":
set {kitpvp.%player%.map} to "farm"
2020-10-24 09:08:29 +00:00
make player execute command "/kitpvp"
2020-10-24 07:03:58 +00:00
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
2020-10-28 00:20:02 +00:00
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"]
2020-10-28 00:54:27 +00:00
format slot 15 of player with bow named "&fJousimies" to close then run [execute player command "/kitpvp setkit archer"]
2020-10-24 07:03:58 +00:00
stop
else:
if arg-2 is "soldier":
2020-10-24 09:08:29 +00:00
set {kitpvp.%player%.kit} to "soldier"
make player execute command "/kitpvp"
2020-10-28 00:22:10 +00:00
stop
if arg-2 is "speedster":
set {kitpvp.%player%.kit} to "speedster"
make player execute command "/kitpvp"
2020-10-24 07:03:58 +00:00
stop
2020-10-28 00:51:41 +00:00
if arg-2 is "archer":
set {kitpvp.%player%.kit} to "archer"
make player execute command "/kitpvp"
stop
2020-10-24 07:03:58 +00:00
stop
else if arg-1 is "start":
2020-10-24 09:08:29 +00:00
set gamemode of player to Survival
remove all items from player
2020-10-24 07:29:45 +00:00
if {kitpvp.%player%.kit} is set:
if {kitpvp.%player%.kit} is "soldier":
2020-10-24 07:35:43 +00:00
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
2020-10-28 00:40:21 +00:00
set slot 0 of player's inventory to 1 of iron sword
2020-10-28 00:20:02 +00:00
if {kitpvp.%player%.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
2020-10-29 15:17:02 +00:00
set the player's walk speed to 0.4
2020-10-28 00:40:21 +00:00
set slot 0 of player's inventory to 1 of gold sword
2020-10-28 00:51:41 +00:00
if {kitpvp.%player%.kit} is "archer":
2020-10-29 15:17:02 +00:00
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
2020-10-28 00:51:41 +00:00
set slot 0 of player's inventory to 1 of bow
2020-10-28 01:06:30 +00:00
set slot 9 of player's inventory to 25 of spectral arrow
2020-10-24 07:29:45 +00:00
else:
make player execute command "/kitpvp"
if {kitpvp.%player%.map} is set:
if {kitpvp.%player%.map} is "winter":
2020-10-24 09:08:29 +00:00
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":
2020-10-29 15:17:02 +00:00
teleport player to location 57, 5, 357
2020-10-24 07:29:45 +00:00
else:
make player execute command "/kitpvp"
2020-10-24 09:08:29 +00:00
if {kitpvp.%player%.started} is not set:
heal the player
set {kitpvp.%player%.started} to true
stop
else if arg-1 is "end":
remove all items from player
clear {kitpvp.%player%.started}
2023-04-23 15:24:30 +00:00
teleport player to spawn of "%player's world%"
2020-10-24 07:03:58 +00:00
stop
else:
stop
stop
else:
stop
2020-10-24 03:31:01 +00:00
on join:
if player's world is "minigames":
2023-04-23 15:24:30 +00:00
teleport player to spawn of "%player's world%"
2020-10-24 04:33:04 +00:00
remove all items from player
2020-10-28 00:20:02 +00:00
set the player's walk speed to 0.2
set slot 7 of player's inventory to 1 of chest named "&fKitPVP"
2020-10-24 03:31:01 +00:00
stop
on respawn:
if player's world is "minigames":
2020-10-28 00:20:02 +00:00
set slot 7 of player's inventory to 1 of chest named "&fKitPVP"
2020-10-24 03:31:01 +00:00
stop
2020-10-28 23:34:37 +00:00
on death:
2023-04-23 15:24:30 +00:00
if victim's world is "minigames":
remove all items from victim
set the victim's walk speed to 0.2
clear {kitpvp.%victim%.started}
2020-10-28 23:34:37 +00:00
clear drops
2020-10-24 04:33:04 +00:00
on quit:
if player's world is "minigames":
remove all items from player
2020-10-24 09:08:29 +00:00
clear {kitpvp.%player%.started}
2020-10-24 04:33:04 +00:00
stop
2020-10-24 03:31:01 +00:00
on leftclick:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
2020-10-24 07:10:45 +00:00
make player execute command "/kitpvp"
2020-10-24 03:31:01 +00:00
cancel the event
wait 2 tick
on rightclick:
if player's world is "minigames":
if event-item is chest named "&fKitPVP":
2020-10-24 07:10:45 +00:00
make player execute command "/kitpvp"
2020-10-24 03:31:01 +00:00
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
2020-10-28 00:28:53 +00:00
on break:
if player's world is "minigames":
if {kitpvp.%player%.started} is set:
cancel event
2020-10-28 14:33:48 +00:00
on block damage:
if player's world is "minigames":
if {kitpvp.%player%.started} is set:
cancel event
2020-10-28 14:53:38 +00:00
on item damage:
2020-10-28 00:28:53 +00:00
if player's world is "minigames":
if {kitpvp.%player%.started} is set:
cancel event
2020-10-24 09:08:29 +00:00
on region exit:
if player's world is "minigames":
wait 1 tick
if "%event-region%" contains "minigames_kitpvp_":
remove all items from player
2020-10-28 00:20:02 +00:00
set the player's walk speed to 0.2
2020-10-27 23:58:38 +00:00
clear {kitpvp.%player%.started}
on hunger meter change:
if player's world is "minigames":
wait 1 tick
2023-04-26 14:44:54 +00:00
feed the player