Sell a full stack while player's sneaking

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

zTak

Active Member
Mar 3, 2018
84
6
8
21
Hey guys,

I skripted a sign shop. And i want to sell a stack of item while a Player is sneaking. This is my Code:
Why it's not working?

Code:
On rightclick on sign:
    if line 1 of event-block is "&8[&cVERKAUFEN&8]":
        set {schildsell.%player%} to line 3 of event-block parsed as a integer
        set {ivnsee.%player%} to line 2 of event-block parsed as a item type
        if inventory of player contains {ivnsee.%player%}:
            remove {ivnsee.%player%} from player's inventory
            add {schildsell.%player%} to {Taler::%uuid of player%}
            set action bar of player to "&8» &7&oDu hast erfolgreich &a%line 2 of event-block% &7&overkauft&8."
        else:
            set action bar of player to "&8» &cDu hast kein %{ivnsee.%player%}% im Inventar&8!"
           

On rightclick on sign:
    if line 1 of event-block is "&8[&cVERKAUFEN&8]":
        if player is sneaking:
            set {schildsell.%player%} to line 3 of event-block parsed as a integer
            set {ivnsee.%player%} to line 2 of event-block parsed as a item type
            if inventory of player contains 64 of line 2 of event-block parsed as a item type:
                loop 64 times:
                    add line 3 of event-block parsed as a integer to {Taler::%uuid of player%}
                remove 64 of {ivnsee.%player%} from player's inventory
                set action bar of player to "&8» &7&oDu hast erfolgreich 64x &a%line 2 of event-block% &7&overkauft&8."
            else:
                set action bar of player to "&8» &cDu hast kein 64x %{ivnsee.%player%}% im Inventar&8!"


@Wolwer

There are no Errors while loading the Skript. Please help!
 
Last edited:
Hey guys,

I skripted a sign shop. And i want to sell a stack of item while a Player is sneaking. This is my Code:
Why it's not working?

Code:
On rightclick on sign:
    if line 1 of event-block is "&8[&cVERKAUFEN&8]":
        set {schildsell.%player%} to line 3 of event-block parsed as a integer
        set {ivnsee.%player%} to line 2 of event-block parsed as a item type
        if inventory of player contains {ivnsee.%player%}:
            remove {ivnsee.%player%} from player's inventory
            add {schildsell.%player%} to {Taler::%uuid of player%}
            set action bar of player to "&8» &7&oDu hast erfolgreich &a%line 2 of event-block% &7&overkauft&8."
        else:
            set action bar of player to "&8» &cDu hast kein %{ivnsee.%player%}% im Inventar&8!"
         

On rightclick on sign:
    if line 1 of event-block is "&8[&cVERKAUFEN&8]":
        if player is sneaking:
            set {schildsell.%player%} to line 3 of event-block parsed as a integer
            set {ivnsee.%player%} to line 2 of event-block parsed as a item type
            if inventory of player contains 64 of line 2 of event-block parsed as a item type:
                loop 64 times:
                    add line 3 of event-block parsed as a integer to {Taler::%uuid of player%}
                remove 64 of {ivnsee.%player%} from player's inventory
                set action bar of player to "&8» &7&oDu hast erfolgreich 64x &a%line 2 of event-block% &7&overkauft&8."
            else:
                set action bar of player to "&8» &cDu hast kein 64x %{ivnsee.%player%}% im Inventar&8!"


@Wolwer

There are no Errors while loading the Skript. Please help!
This could be wrong and not work, but you can try this:

code_language.skript:
on rightclick on sign:
    if line 1 of event-block is "&8[&cVERKAUFEN&8]":
        if player is sneaking:
            set {schildsell.%player%} to line 3 of event-block parsed as number
            set {ivnsell.%player%} to line 2 of event-block parsed as item type
            if player's inventory contains 64 of {ivnsell.%player%}:
                loop 64 times:
                    add {schildsell.%player%} to {Taler::%uuid of player%}
                remove 64 of {ivnsee.%player%} from player's inventory
                set action bar of player to "&8» &7&oDu hast erfolgreich 64x &a%line 2 of event-block% &7&overkauft&8."
            else:
                set action bar of player to "&8» &cDu hast kein 64x %{ivnsee.%player%}% im Inventar&8!"
I have ran into an issue like this before, I don't know if its the same problem but "inventory of player" has never really worked right for me. If you change it to "player's inventory" it may fix your issue.
 
Status
Not open for further replies.