Solved Giving players items

  • 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 comminuty!

    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.

JackyBoy

Member
Feb 4, 2017
104
1
18
21
Hey there! (me again, sorry that I keep asking things) Anyway is there a way to give players an item in a slot with a custom name so if an admin does /key give Notch 5 it would give the player Notch 5 nether stars in the 6th slot.
This is my code

code_language.skript:
command /Key-give %player%:
    trigger:
        set slot 6 of %player% to nether_star named "&d&o&lMystery Key" with lore "&7(Right Click) To open a mystery crate!"
 
code_language.skript:
command /key [<text>] [<player>] [<number>]:
 permission: permission.permission
 permission message: &cYou don't have permission
 trigger:
  set {_usage} to "Usage: /key give <player> <number>"
  if arg 1 isn't "give":
   send "%{_usage}%"
   stop trigger
 
  if arg 2 isn't set:
   send "%{_usage}%"
   stop trigger
 
  if arg 3 isn't set:
   send "%{_usage}%"
   stop trigger

  set slot 6 of arg-2 with nether star named "Name" with lore "Lore"
 
It's good that you want to help the people but spoonfeed the people wouldn't help in any way.

Now, regarding to the OP's issue, in the patterns showed on the docs, the %type% is the type that you have to put there, not the exact pattern, for example if the item in slot expression is:
code_language.skript:
%inventory holder%'s slot %number%
[the] slot %number% of %inventory%
so, the %number% is the slot you want and the %inventory holder% is the inventory where you're trying to get/set the slot. in your case it'll be:
code_language.skript:
set slot 6 of sender's inventory to nether star named "&o&lMystery Key" with lore "&7(Right Click) To open the mistery crate!"
 
Status
Not open for further replies.