Hi everyone,
I'm working on a script and I need help to make it correctly detect the direction the player is facing. Could you provide some guidance on how to achieve this? Also, here is the current version of the script I’m using:
I'm working on a script and I need help to make it correctly detect the direction the player is facing. Could you provide some guidance on how to achieve this? Also, here is the current version of the script I’m using:
Code:
# Configurazione delle opzioni
options:
item1: Netherite Sword
item2: Golden Apple
item3: Iron Chestplate
item4: Nether Star
menuText: &eMenu RPG
# Comando per aprire il menu
command /menu:
trigger:
if {menu.%player%} is true:
delete {menu.%player%}
delete holo object "%player%.menu"
stop
else:
set {menu.%player%} to true
set {_loc} to location of player
add 2 to y-coordinate of {_loc}
create holo object "ItemStack:{@item1};{@menuText}" with id "%player%.menu" at {_loc}
set {menuItems::1} to {@item1}
set {menuItems::2} to {@item2}
set {menuItems::3} to {@item3}
set {menuItems::4} to {@item4}
set {currentMenuIndex.%player%} to 1
# Gestione dei clic del giocatore
on rightclick:
if {menu.%player%} is true:
add 1 to {currentMenuIndex.%player%}
if {currentMenuIndex.%player%} is greater than 4:
set {currentMenuIndex.%player%} to 1
set {_item} to {menuItems::%{currentMenuIndex.%player%}%}
delete holo object "%player%.menu"
set {_loc} to location of player
add 2 to y-coordinate of {_loc}
create holo object "ItemStack:%{_item}%;{@menuText}" with id "%player%.menu" at {_loc}
on leftclick:
if {menu.%player%} is true:
remove 1 from {currentMenuIndex.%player%}
if {currentMenuIndex.%player%} is less than 1:
set {currentMenuIndex.%player%} to 4
set {_item} to {menuItems::%{currentMenuIndex.%player%}%}
delete holo object "%player%.menu"
set {_loc} to location of player
add 2 to y-coordinate of {_loc}
create holo object "ItemStack:%{_item}%;{@menuText}" with id "%player%.menu" at {_loc}
# Pulizia dopo 30 secondi
every 30 seconds:
loop all players:
if {menu.%loop-player%} is true:
delete {menu.%loop-player%}
delete holo object "%loop-player%.menu"