#Players in GUI
1 messages · Page 1 of 1 (latest)
ok, good luck!
I wrote because i need help...
thats nice
but we cant help you
unless you explain your issue
and show your code
we aren't here to write it for you
you have to code some shit
Then you need to actually have an issue
the problem is that it's too complicated and I don't even know what to put in the code
command /staff [<text>] [<offlineplayer>] [<string>]: permission: {@permadmin} permission message: {@noperm} aliases: /staffutils, /managestaff trigger:
well you'll need a gui
created
then check if the first slot
has an item in it
then if not then set slot 1 to thingy
then set an item with %arg-2%
then add lore like Rank: %arg-3%
then save the gui / inventory
then load it whenver it opens
`command /staff [<text>] [<offlineplayer>] [<string>]:
permission: {@permadmin}
permission message: {@noperm}
aliases: /staffutils, /managestaff
trigger:
if arg-1 isn't set:
openStaff(player)
function openStaff(p: player):
set {_gui} to a new chest inventory with 6 rows named "Lista Staff"
open {_gui} to {_p}`
the problem is how to fill the gui
but how do I add a player with the /staff add command, it would mean modifying the code every time a player is added
nope
this is the problem I encounter
no which slot should I put since every time I add a player it must also be added to the gui
ohh, the gui displays staff members?
use a list variable to store the players you added when using the add argument
add their skulls (or whatever to display) to a list, then loop that and fill the gui
command /staff [<text>] [<offlineplayer>] [<string>]: permission: {@permadmin} permission message: {@noperm} aliases: /staffutils, /managestaff trigger: if arg-1 isn't set: openStaff(player, arg-2, arg-3) if arg-1 is "add": if {staff::*} doesn't contain arg-2: if arg-2 is set: if arg-2 is online: if arg-3 is set: add arg-2 to {staff::*}
after writing this, what is the action I need to add in the function to be able to add the player to the gui?
umm
- shouldnt you check if arg-2 is set before you add?
- no need to check if they are online, is there?
- you should add their UUID, because they might change their usernames
- what's the point of arg-3?
as for adding them to the gui, loop the list
then you can set slot loop-iteration
I check if he is online just to edit the message for when he is offline more easily
`command /staff [<text>] [<offlineplayer>] [<string>]:
permission: {@permadmin}
permission message: {@noperm}
aliases: /staffutils, /managestaff
trigger:
if arg-1 isn't set:
openStaff(player, arg-2, arg-3)
if arg-1 is "add":
if {staff::} doesn't contain arg-2:
if arg-2 is set:
if arg-2 is online:
if arg-3 is set:
add arg-2's uuid to {staff::}
function openStaff(p: player, v: player, c: text):
loop {staff::*}:
set {_gui} to a new chest inventory with 6 rows named "Lista Staff"
set slot loop-value of {_GUI} to skull of {_v} parsed as offline player named "&f%{_v}%" with lore "&3Ruolo &8» &b%{_c}%"
open {_gui} to {_p}`
and opening it each loop
I don't have the slightest idea how to do this please
loop ...
...
open {_gui}```
you want loop-iteration, not loop-value. loop-value would be the player, which is not a valid slot
but loop-iteration doesn't work
function openStaff(p: player, v: player, c: text): set {_gui} to a new chest inventory with 6 rows named "Lista Staff" loop {staff::*}: set slot loop-iteration of {_GUI} to skull of {_v} parsed as offline player named "&f%{_v}%" with lore "&3Ruolo &8» &b%{_c}%" open {_gui} to {_p}

loop-iteration works for skript version 2.8.0+
also, you want skull of (loop-value parsed as offline player)
I work with script 2.6.4...
well update
no reason not to
I recently updated from 2.7.3 to 2.8.0 and plan on upgdating to the latest version soon
I didnt have to change much
Only the with all flags hidden -> with all itemflags thing
then good luck getting support
`command /staff [<text>] [<offlineplayer>] [<string>]:
permission: {@permadmin}
permission message: {@noperm}
aliases: /staffutils, /managestaff
trigger:
if arg-1 isn't set:
openStaff(player, arg-2, arg-3)
if arg-1 is "add":
if {staff::} doesn't contain arg-2:
if arg-2 is set:
if arg-2 is online:
if arg-3 is set:
add arg-2's uuid to {staff::}
function openStaffGUI(p: player, v: player, c: text):
set {_gui} to a new chest inventory with 6 rows named "Lista Staff"
loop {staff::*}:
set slot loop-iteration of {_GUI} to (loop-value parsed as offline player) named "&f%loop-value%" with lore "&3Ruolo &8» &b%{_c}%"
open {_gui} to {_p}`
I did this but the gui doesn't even open
you forgot the skull of part
nonoi updated skript
i only highlighted the parsing part, you replace {_v} with that, not skull of {_v}
function openStaff(p: player, v: player, c: text): set {_gui} to a new chest inventory with 6 rows named "Lista Staff" loop {staff::*}: set slot loop-iteration of {_GUI} to (skull of loop-value parsed as offline player) named "&f%loop-value%" with lore "&3Ruolo &8» &b%{_c}%" open {_gui} to {_p}
it still doesn't open
my eyes
not sure why the function needs 3 parameters
is the function being called?
add a broadcast in the function
function openStaff(p: player): set {_gui} to a new chest inventory with 6 rows named "Lista Staff" loop {staff::*}: set slot loop-iteration of {_gui} to (skull of loop-value parsed as offline player) named "&f%loop-value%" with lore "&3Ruolo &8» &b%{_c}%" open {_gui} to {_p} broadcast "prova"
does not send the broadcast.
a video?
or you know, just type it in
but the command does nothing, it doesn't type anything
if you execute the command with arguments, this section will not run
i know
if i execute the command with arguments, i add players, if i execute cmd without args, i open the gui
but the gui with /staff doesn't open
yes is passed
send sk info
/sk info?
yes
do /sk info & then send a screenshot
delete skquery
does it work now?
no, works only the broadcast...
`command /staff [<text>] [<offlineplayer>] [<string>]:
permission: {@permadmin}
permission message: {@noperm}
aliases: /staffutils, /managestaff
trigger:
if arg-1 isn't set:
openStaff(player)
broadcast "test"
if arg-1 is "add":
if {staff::} doesn't contain arg-2's uuid:
if arg-2 is set:
if arg-2 is online:
if arg-3 is set:
add arg-2's uuid to {staff::}
set {ruolostaff::%arg-2's uuid%} to arg-3
send "&a%arg-2% aggiunto con successo come %arg-3%!"
if arg-1 is "remove":
if {staff::} contains arg-2's uuid:
if arg-2 is set:
if arg-2 is online:
remove arg-2's uuid from {staff::}
send "&a%arg-2% rimosso con successo dallo staff!"
function openStaff(p: player):
set {_gui} to a new chest inventory with 6 rows named "Lista Staff"
loop {staff::*}:
set slot loop-iteration of {_gui} to (skull of loop-value parsed as offline player) named "&f%loop-value%" with lore "&3Ruolo &8» &b%{_c}%"
open {_gui} to {_p}`
because i'm working on 1.16.5 server
i can't, the mode must be 1.16.5
then good luck
uh