Solved Problems with the GUI

Discussion in 'Spigot Plugin Help' started by TryksORG, Jan 30, 2020.

Thread Status:
Not open for further replies.
  1. Hey, guys, I need your help. So I'm writing a troll plugin for a server. Now it is so that I have built a CustomGUI for it; Each Troll Individually now my problem is that I don't know how to select a player so that all "commands" in the GUI refer to this one player? Do you have a way to do that? You just have to type /trollthis [player name] and then all commands in the GUI have to refer to this player.

    TIA ~ Tryks
  2. what GUI plugin are you using ?
    I know how to do this, but only with DeluxeMenus and its new Arguments
  3. I assume you’re using CustomGUI? Regardless of what plugin you’re using, you should post in its discussion thread or on the support Discord server.
  4. I create the GUI myself
  5. I create the GUI myself
  6. with a custom plugin ? then I have no idea
    • Agree Agree x 1
  7. Wrong section but here's your answer: Once a player do /trollthis <player> you put the targetted player's head in the first slot of the inventory with his name so the command sender know who he is targetting and when you click on something in the gui it gets the head's owner UUID to run commands and stuff. you could also add lores to show the command sender how much hp the player has, how much exp, etc.
    • Winner Winner x 2
  8. Maybe just open an Inventory and name it like the Player-Name:

    For example:
    Code (Java):
    Bukkit.createInventory(null,5*9(Size),"Troll "+player.getName);
    And afterwards in your listener (InventoryInteractEvent) class, you would just ask if the Inventory's name contains "Troll"
    and then you just split Troll and the name to get the name :)

    Oh and, don't forget to cancel the event :^)
    • Informative Informative x 1
    • Useful Useful x 1
  9. Is also a great way and probably more beautiful to look at.
    • Agree Agree x 1
    • Informative Informative x 1
  10. Thank ya all
Thread Status:
Not open for further replies.