Need help with conditions

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

claytyne

Member
May 12, 2020
26
0
1
23
i need a help with my /home command. i want to it charge 5 coins. It teleports you if you enough, but it doesn't remove the coins.

here's the code:

Code:
command /home:
    description: Teleport yourself to your home
    trigger:
        if {home.%player%} is not set:
            play sound "block.note_block.bass" to player
            message "&cYou have not set your home yet!"
            stop

        if player has 5 gold nuggets named "&6&l&oCoin":
            teleport player to {home.%player%}
            play sound "entity.experience_orb.pickup" to player
            remove 5 gold nugget named "&6&l&Coin" from player's inventory
        else:
            message "&cYou don't have enough coins!"
            play sound "block.note_block.bass" to player
 
Code:
command /home:
    description: Teleport yourself to your home
    trigger:
        if {home.%player%} is not set:
            play sound "block.note_block.bass" to player
            message "&cYou have not set your home yet!"
            stop
 
        if player has 5 gold nuggets named "&6&l&oCoin":
            teleport player to {home.%player%}
            play sound "entity.experience_orb.pickup" to player
            remove 5 gold nuggets named "&6&l&Coin" from player
        else:
            message "&cYou don't have enough coins!"
            play sound "block.note_block.bass" to player
This should work
 
Code:
command /home:
    description: Teleport yourself to your home
    trigger:
        if {home.%player%} is not set:
            play sound "block.note_block.bass" to player
            message "&cYou have not set your home yet!"
            stop
 
        if player has 5 gold nuggets named "&6&l&oCoin":
            teleport player to {home.%player%}
            play sound "entity.experience_orb.pickup" to player
            remove 5 gold nuggets named "&6&l&Coin" from player
        else:
            message "&cYou don't have enough coins!"
            play sound "block.note_block.bass" to player
This should work
thanks!
 
Won't work.
The first name in the code is "&6&l&oCoin", and the second is "&6&l&Coin"
 
Status
Not open for further replies.