Hello I have a question and I need help with it, so I want to do /genees (player) and it will open a GUI but the GUi is only opening for myself so the person who was entering the command how can I change that to the input on the (player)
Code:
command /genees [<player>]:
permission: ziekenhuis.genees
permission message: &cJe hebt geen permissions.
trigger:
if arg-1 is not set:
send "&cJe moet een spelers naam opgeven" to player
else:
genees(player)
function genees(p: player):
set {_puuid} to uuid of {_p}
open chest with 3 rows named "&cGenees &f- Thuisscherm" to {_p}
set {_terug} to "MHF_ArrowLeft" parsed as an offline player
create a gui slot 21 of {_p} with {_terug}'s skull named "&cGa Terug" to run:
close player's inventory
create a gui slot 4 of {_p} with clock named "&4❤ &aGenees Speler" to run:
geneees({_p})
function geneees(p: player):
set {_puuid} to uuid of {_p}
open chest with 3 rows named "&cGenees &f- Thuisscherm" to {_p}
set {_terug} to "MHF_ArrowLeft" parsed as an offline player
create a gui slot 21 of {_p} with {_terug}'s skull named "&cGa Terug" to run:
genees({_p})
create a gui slot 4 of {_p} with golden apple named "&4❤ &aGenees Speler" with lore "&aKlik hier om &4&l%{_p}% &ate genezen" to run:
chance of {@slaag-kans}:
heal ({_p})
set player's food to 20
send "&aU heeft succesvol %player% &ageholpen!"
close player's inventory
else:
send "&cU heeft onsuccesvol %{_p}% &cgeholpen!"
close player's inventory
set player's health to 2
set player's food to 2
set {_health} to health of {_p}
wait 5 seconds
if {_health} is 2:
send title "&cHelaas bent u overleden aan uw verwondingen" to {_p} with fadein 0 ticks and fadeout 7 ticks
set {onze.spawn} to location -171.622, 77, 170.414 in world "world"
teleport {_p} to {onze.spawn}
set player's health to 20
set player's food to 20