#GUI Args

1 messages · Page 1 of 1 (latest)

dusk owl
#

Hello,
So I’ve been trying to Skript a vanilla GUI
that includes args,
Example of what I’m trying to do below:
On command /duels <player>,
Open gui with 2 options, pvp duels and sumo duels. On click of one of the options it respectively would make the player execute either “sumoduel <args>” or “pvpduel <args>”
I cannot install something like Skript GUI or TuSKe as it’s a 1.19.4 server.

I am sort of new to Skript so I don’t really understand how to do this. I have got the actual GUI Skript and everything just the gui doesn’t work.

Thanks for reading

#

Also I’ve tried to set {_p} to args but doesn’t work

proud marlin
#

Please learn skript before asking any questions, you can't use arg on another event because arg only used on commands, a way you can do by creating a var and make the var the arg

dusk owl
#

That’s what I tried, it diddnt work

proud marlin
dusk owl
#

Okay, give me a second

dusk owl
#

`command /duel <player>:
trigger:
set {_var} to arg-1
set metadata tag "duelsmenu" of player to chest inventory with 1 rows named "&cWhat Type of Duel?"
set slot 2 of metadata tag "duelsmenu" of player to stone sword named "&cPVP Duels" with lore "&bPlayer: %player%" and "&bCommunity Levels Completed: %{stats::%player%}%"
set slot 7 of metadata tag "duelsmenu" of player to snowball named "&cSumo Duels" with lore "&bClick on a send %{_player}% a sumoduel!"
open (metadata tag "duelsmenu" of player) to player

on inventory click:
if event-inventory = (metadata tag "duelsmenu" of player):
cancel event
if index of event-slot is 2:
cancel event
make player execute command "pvpduel %{_var}%"
if index of event-slot is 4:
cancel event
make player execute command "sumoduel %{_var}%"`

#

oops sorry the {_player} was supposed to be {_var}

proud marlin
#

Oh god no..

proud marlin
dusk owl
#

I Don't know what that means, I've only recently started with vars

proud marlin
#

{var} this is a normal var [what u should use]
{_var} local var will be auto deleted when the commands ends and can not use outside there local

dusk owl
#

so i'd just set the _var to var?

proud marlin
#

Yes

dusk owl
#

Omg, im such an idiot thank you

proud marlin
#

Check out this for more info

dusk owl
#

Thanks, ill have a look