Input as target

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

NandoGaming_420

New Member
May 5, 2020
9
0
1
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
 
the second one, but how did you make a whole function without knowing how command arguments work
This is not working. It is not opening the GUI. It is only opening for the player you enter but if I enter the command I need to get the GUI not the player I enter
 
Status
Not open for further replies.