Code not works

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

varboosted

Active Member
Apr 20, 2020
50
3
8
24
Code:
on world change:
    wait 3 ticks
    loop all items in inventory of player:
        if loop-item is emerald named "&6Shop &7(Right-click)":
            wait 20 seconds
            loop all items in inventory of player:
                if loop-item-2 is emerald named "&6Shop &7(Right-click)":
                    message "&cYou need to select a kit! &7(&bAuto Kick in &f40 &bSeconds&7)" to the player
                    wait 20 seconds
                    loop all items in inventory of player:
                        if loop-item-3 is emerald named "&6Shop &7(Right-click)":
                            message "&cYou need to select a kit! &7(&bAuto Kick in &f20 &bSeconds&7)" to the player
                            wait 10 seconds
                            loop all items in inventory of player:
                                if loop-item-4 is emerald named "&6Shop &7(Right-click)":
                                    message "&cYou need to select a kit! &7(&bAuto Kick in &f10 &bSeconds&7)" to the player
                                    wait 10 seconds
                                    loop all items in inventory of player:
                                        if loop-item-5 is emerald named "&6Shop &7(Right-click)":
                                            make console execute command "/kick %player% You didn't select a kit so you left the game!"
                                            message "&cYou didn't select a kit so you left the game!" to the player



not works at all, when moving a world and we you have the emerald named like this it just doesnt works and when you reload the skript there isn't any errors

it loops if there is an item, when you join the map of kitpvp it you have that emerald
and if he is afk for 1 minute and not choosing a kit (his emerald will disappear if he select a kit) he get kick that is the code
[doublepost=1621075327,1620042125][/doublepost]bump
 
Try changing "named" to "with name" and see if that makes any difference, it may have been the fix for one of my errors in the past. You can also split up the if-statement into two separate checks; one checking the item type, another to check the item's name.
Code:
loop-item is an emerald
name of loop-item is colored "&6Shop &7(Right-click)"
apply levitation 200 to player for 100 seconds
 
Try changing "named" to "with name" and see if that makes any difference, it may have been the fix for one of my errors in the past. You can also split up the if-statement into two separate checks; one checking the item type, another to check the item's name.
Code:
loop-item is an emerald
name of loop-item is colored "&6Shop &7(Right-click)"
apply levitation 200 to player for 100 seconds
With name doesn't change anything,

tried this to test and also doesn't work:
Code:
on world change:
    wait 3 ticks
    loop all items in inventory of player:
        loop-item is an emerald
        name of loop-item is colored "&6Shop &7(Right-click)"
        message "&cYou need to select a kit! &7(&bAuto Kick in &f40 &bSeconds&7)" to the player
 
Try changing it to that
Code:
on world change:
    wait 3 ticks
    loop all items in inventory of player:
        loop-item is an emerald named "&6Shop &7(Right-click)":
            send "&cYou need to select a kit! &7(&bAuto Kick in &f40 &bSeconds&7)" to player
 
Try changing it to that
Code:
on world change:
    wait 3 ticks
    loop all items in inventory of player:
        loop-item is an emerald named "&6Shop &7(Right-click)":
            send "&cYou need to select a kit! &7(&bAuto Kick in &f40 &bSeconds&7)" to player
Not works
upload_2021-5-19_15-2-37.png
 
Status
Not open for further replies.