O
OlliPausW
Guest
Hallo, ich habe vor ein Plugin zu schreiben, mit dem man sein Inventar wechseln kann.
Doch leider gibt es da ein Problem:Skript kann zwar alles speichern was ich im Inventar habe, doch es weiß nicht was es tun soll wenn mein Inventar Leer ist und ich es speichern willl. Wenn mein Inventar leer ist und ich versuche es zu speichern überschreibt es die Variable nicht sondern lässt sie einfach so. Hier mit Skript code.
Doch leider gibt es da ein Problem:Skript kann zwar alles speichern was ich im Inventar habe, doch es weiß nicht was es tun soll wenn mein Inventar Leer ist und ich es speichern willl. Wenn mein Inventar leer ist und ich versuche es zu speichern überschreibt es die Variable nicht sondern lässt sie einfach so. Hier mit Skript code.
Code:
command /change [<text>]:
permission: skript.invchange
usage:&c/change <1-2> oder /change
trigger:
if {inv.%player%} is not set:
set {inv.%player%} to "1"
wait 0.2 seconds
if {inv.%player%} is "1":
if argument is "1":
message "&cFehler: Du hast bereits Inventar 1!"
stop
if argument is "2":
if player's inventory is not empty:
set {inventory1.%player%::*} to items in the player's inventory
if player's inventory is empty:
set {inventory1.%player%::*} to air
set {chestplate1.%player%} to chestplate of the player
set {helm1.%player%} to helm of the player
set {leg1.%player%} to leg of the player
set {boot1.%player%} to boot of the player
wait 0.2 seconds
clear the inventory of the player
give {inventory2.%player%::*} to the player
set chestplate of the player to {chestplate2.%player%}
set helm of the player to {helm2.%player%}
set leg of the player to {leg2.%player%}
set boot of the player to {boot2.%player%}
set {inv.%player%} to "2"
message "&6Du hast nun Inventar &32&6."
stop
if {inv.%player%} is "2":
if argument is "1":
if player's inventory is empty:
set {inventory2.%player%::*} to air
message "test"
else:
set {inventory2.%player%::*} to items in the player's inventory
message "works"
wait a second
set {chestplate2.%player%} to chestplate of the player
set {helm2.%player%} to helm of the player
set {leg2.%player%} to leg of the player
set {boot2.%player%} to boot of the player
wait 0.2 seconds
clear the inventory of the player
give {inventory1.%player%::*} to the player
set chestplate of the player to {chestplate1.%player%}
set helm of the player to {helm1.%player%}
set leg of the player to {leg1.%player%}
set boot of the player to {boot1.%player%}
set {inv.%player%} to "1"
message "&6Du hast nun Inventar &31&6."
stop
if argument is "2":
message "&cFehler: Du hast bereits Inventar 2!"
stop
if argument is not set:
message "&6Du hast momentan Inventar &3%{inv.%player%}%"