Discord Thread Sellwand with Uses | Skript

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

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,755
1
0
The skUnity Discord
discord.gg
I'm looking to add Uses to my sellwands, but I'm unsure on how to actually add them, could I get some help?
Right now argument 3 does nothing in the sellwandgive command, so that'd be great help too.

code_language.skript:
command /sellwandgive [<player>] [<number>] [<number>]:
    permission: op
    trigger:
        if arg-1 is set:
            if arg-2 is set:
                give arg-1 1 of blaze rod named "<##C5FB42>&lSELLWAND &7[<##C5FB42>%arg-2%x&7]" with lore "&8Sellwand", "", "<##0C9039>│ <##C5FB42>Description", "<##0C9039>│ &fSell items in a chest.", "", "<##0C9039>│ <##C5FB42>Statistics", "<##0C9039>│ &fMultiplier: <##C5FB42>%arg-2%x", "<##0C9039>│ &fUses: <##C5FB42>%arg-2%x", "", "&7&oRight-Click on a chest to use."
            else:
                give arg-1 1 of blaze rod named "<##C5FB42>&lSELLWAND &7[<##C5FB42>1x&7]" with lore "&8Sellwand", "", "<##0C9039>│ <##C5FB42>Description", "<##0C9039>│ &fSell items in a chest.", "", "<##0C9039>│ <##C5FB42>Statistics", "<##0C9039>│ &fMultiplier: <##C5FB42>1x", "", "&7&oRight-Click on a chest to use."
        else:
            send "{@prefix} &f/sellwandgive [player] [multiplier] [uses] ."           

on rightclick on chest or hopper with blaze rod:
    if player's tool is blaze rod named "<##C5FB42>&lSELLWAND &7[<##C5FB42>1x&7]":
        set {_name} to uncolored name of player's tool
        replace all "(", ")", "SELLWAND", " " and "x" with "" in {_name}
        set {_multiplier} to 1
        sellItems(player, inventory of clicked block, {_multiplier}+0)
        cancel event

Posted by: deegl from the skUnity Discord. View the thread on skUnity Discord here
 
just make the args mandatory, then you don't need to check if they are set.
also, make a variable for the wand and then give players that variable
code_language.skript:
on load:
  set {wand} to 1 of stick named "Wand"
  set line 1 of {wand}'s lore to "Magic!"

command givewand:
  trigger:
    give player 1 of {wand}

Posted by: x8ight from the skUnity Discord.
 
Status
Not open for further replies.