Solved Else: 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 community!

    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.

bobby

Active Member
Jan 28, 2017
61
0
6
code_language.skript:
     loop items in player's inventory:
       loop-item is a written book:
         title of loop-item is "Welcome book":
           author of loop-item is "notch":
             remove loop-item from player's inventory
       else:
         send "Player doesn't have notch book" to arg 1
So I got that and I'm getting no errors but even if the player has a written book and it removes it, it messages me Player doesn't have notch book. Help?
 
code_language.skript:
     loop items in player's inventory:
       loop-item is a written book:
         title of loop-item is "Welcome book":
           author of loop-item is "notch":
             remove loop-item from player's inventory
       else:
         send "Player doesn't have notch book" to arg 1
So I got that and I'm getting no errors but even if the player has a written book and it removes it, it messages me Player doesn't have notch book. Help?
Thats because youre looping every item in the players inventory and checking if every item is a written book so as long as the player has at least 1 item thats not a written book it will send the message.
 
Thats because youre looping every item in the players inventory and checking if every item is a written book so as long as the player has at least 1 item thats not a written book it will send the message.
Oh, Okay that makes sense. Thanks.
 
Status
Not open for further replies.