Inventory Looping problem

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

Viiral

New Member
Apr 26, 2019
9
0
0
19
England
Layout:

Skript Version (do not put latest): Skript 2.2 (dev20c)
Skript Author: Bensku
Minecraft Version: 1.8.8
---
Full Code:
https://pastebin.com/xgZgc79b - full code
https://pastebin.com/tqic47Ku - the part i have problems with


Troubleshooting:
Have you tried searching the docs?
Yes
Have you tried searching the forums? Yes


So I basically want it so it sets a value to false and removes a potion effect if an item goes missing from a players inventory but I can't seem to make it work. If you need more information just say
 
Last edited:
Are you using SharpSK? If not, try installing it and using. Otherwise, try this in replacement for "remove strength from player" Also, this could lag your server out a bunch. If the player moved his head a single digit in the pitch, it would loop every item in the player's inventory 10 times. This is slight movement and a lot of work to do, but if it doesn't lag your server, I guess it'll work.
Code:
on any movement:
    if {strength::%player%::active} is true:
        loop all items in player's inventory:
            if loop-item is a prismarine shard named "&b&lOptic Rune (&c&lStrength&b&l)" with lore "&7Keep this item in your inventory.||&7Can be used by anyone to gain||&7a passive advantage against enemies!||||&b&lRune Bonus:|| &b&l*&b Strength IV":
                stop
            else:
                message ""
                message "&b&l(!) Optic Rune:&b You have &cdisabled&b your strength rune!"
                message ""
                    remove speed from player's active potion effects
 
Are you using SharpSK? If not, try installing it and using. Otherwise, try this in replacement for "remove strength from player" Also, this could lag your server out a bunch. If the player moved his head a single digit in the pitch, it would loop every item in the player's inventory 10 times. This is slight movement and a lot of work to do, but if it doesn't lag your server, I guess it'll work.
Code:
on any movement:
    if {strength::%player%::active} is true:
        loop all items in player's inventory:
            if loop-item is a prismarine shard named "&b&lOptic Rune (&c&lStrength&b&l)" with lore "&7Keep this item in your inventory.||&7Can be used by anyone to gain||&7a passive advantage against enemies!||||&b&lRune Bonus:|| &b&l*&b Strength IV":
                stop
            else:
                message ""
                message "&b&l(!) Optic Rune:&b You have &cdisabled&b your strength rune!"
                message ""
                    remove speed from player's active potion effects
What should I do instead to dectect it
 
I recommend updating skript to 2.4.1. Also 1.12.2 or 1.13.2 minecraft is better but that's up to you. You're using a version of 1.8 skript on a 1.11 server
 
Status
Not open for further replies.