Solved OPPrison Auto Sell Help

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

SnaderMC

Member
Sep 7, 2019
10
1
0
20
idk what i did wrong, no errors. It just don't work.

Code:
on join:
    set {autosell.%player%} to 0
 
command /autosell:
    trigger:
        if {autosell.%player%} is 0:
            set {autosell.%player%} to 1
            send "&a&lAUTOSELL &8: &aActivated!"
        else:
            set {autosell.%player%} to 0
            send "&a&lAUTOSELL &8: &cDeactivated!"
 
every 1 seconds:
    loop all players:
        if {autosell.%loop-player%} is 1:
            loop all items in the loop-player's inventory:
                add 1 to {fullinv.%loop-player%}
            if loop-player's boots is not empty or air:
                subtract 1 from {fullinv.%loop-player%}
            if loop-player's leggings is not empty or air:
                subtract 1 from {fullinv.%loop-player%}
            if loop-player's chestplate is not empty or air:
                subtract 1 from {fullinv.%loop-player%}
            if loop-player's helmet is not empty or air:
                subtract 1 from {fullinv.%loop-player%}
            if {fullinv.%loop-player%} is 36:
                send "&a&lAUTOSELL &8: &cFull inventory!" to loop-player
                execute loop-player command "sell"
 
What doesn't work?
[doublepost=1567923683,1567923646][/doublepost]Btw. 'AutoSell' There is not a command for /sell - the last line
 
What doesn't work?
[doublepost=1567923683,1567923646][/doublepost]Btw. 'AutoSell' There is not a command for /sell - the last line
I have another skript with /sell, just didn't wanna post it because my sell skript works 100%

It won't sell when you have full inventory.
[doublepost=1567972167][/doublepost]Fixed it myself.
Code:
on join:
    set {autosell.%player%} to 0

command /autosell:
    trigger:
        if {autosell.%player%} is 0:
            set {autosell.%player%} to 1
            send "&a&lAUTOSELL &8: &aActivated!"
        else:
            set {autosell.%player%} to 0
            send "&a&lAUTOSELL &8: &cDeactivated!"

every 1 seconds:
    loop all players:
        if {autosell.%loop-player%} is 1:
            set {_full} to 0
            loop all items in the loop-player's inventory:
                add 1 to {_full}               
            if {_full} is 36:
                send "&a&lAUTOSELL &8: &cFull inventory!" to loop-player
                execute loop-player command "sell"
 
I have another skript with /sell, just didn't wanna post it because my sell skript works 100%

It won't sell when you have full inventory.
[doublepost=1567972167][/doublepost]Fixed it myself.
Code:
on join:
    set {autosell.%player%} to 0

command /autosell:
    trigger:
        if {autosell.%player%} is 0:
            set {autosell.%player%} to 1
            send "&a&lAUTOSELL &8: &aActivated!"
        else:
            set {autosell.%player%} to 0
            send "&a&lAUTOSELL &8: &cDeactivated!"

every 1 seconds:
    loop all players:
        if {autosell.%loop-player%} is 1:
            set {_full} to 0
            loop all items in the loop-player's inventory:
                add 1 to {_full}             
            if {_full} is 36:
                send "&a&lAUTOSELL &8: &cFull inventory!" to loop-player
                execute loop-player command "sell"
Just use 'if loop-player has enough space for 64 dirt:' instead of loop all items, that cause lag.
Every second: and loop all players: is a lag generator. Do you want me to make the skript so it doesn't generate lag?
[doublepost=1568044258,1568005571][/doublepost]This is with just less lag..
Code:
on join:
    set {autosell.%player%} to 0
 
command /autosell:
    trigger:
        if {autosell.%player%} is 0:
            set {autosell.%player%} to 1
            send "&a&lAUTOSELL &8: &aActivated!"
            while {autosell.%player%} is 1:
                if player has enough space for 64 dirt:
                    execute player command "/sell"
                wait 2 seconds
        else:
            set {autosell.%player%} to 0
            send "&a&lAUTOSELL &8: &cDeactivated!"
 
Status
Not open for further replies.