1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT??:

    You can always check our our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Book

Discussion in 'Skript' started by Hibrocolomedio, Dec 14, 2017.

Thread Status:
Not open for further replies.
  1. Hibrocolomedio

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
    Software I'm using:
    Spigot 1.12.2
    Skript (Bensku's Fork)
    Skellett

    What I am trying to achieve:
    On my server I have an ingame book item which has some information. What I want is when they type in /help to the chat, the book shows up, but without putting the book into their inventory.
    ∑: Converting an already made book into a virtual book.

    What I am trying to achive with code:
    So basically instead of this:
    Code (Skript):
    1. command /help:
    2.     trigger:
    3.         set {_book} to a new book
    4.         open book {_book} to player
    I want to do this:
    Code (Skript):
    1. command /help:
    2.     trigger:
    3.         set {_book} to an already existing ingame book
    4.         open book {_book} to player
    I just do not know how to convert the ingame book into a variable that I can set {_book} to. And this is what I am looking for, a way to do this.

    Have you tried searching the docs? Yes

    Have you tried searching the forums? No Already yes

    Other:
    If possible I want to use only Skript and Skellett as I don't want to install more plugins on my server, I already have too many. If however I need to install another plugin in order to do this, suggest a plugin that is a Skript addon that is very useful and has many other features as well atleast.

    If anyone is able to help, I would really apprichiate it.
    Thanks! :emoji_slight_smile:
     
    #1 Hibrocolomedio, Dec 14, 2017
    Last edited: Dec 14, 2017
  2. Mr_Simba

    Mr_Simba King of the Pridelands
    Moderator Supporter

    Joined:
    Dec 9, 2016
    Messages:
    257
    Likes Received:
    55
    Medals:
    Can't you just store the already existing book in a variable and then open it to them from that variable?

    If not, and you need a way to transfer the pages from the other book to a "Skellett book" (not sure how Lime made it work internally), then you should be able to use this expression to loop through its pages and this effect to add the pages to it, i.e.

    Code (Skript):
    1. set {_bookToOpen} to a new book
    2. loop book pages of {existingBook}:
    3.     add page with data loop-value to {_bookToOpen}
    4. open book {_bookToOpen} to player
    Haven't used the Skellett book stuff yet so hopefully that works, or at least you get the idea!
     
  3. Hibrocolomedio

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
    How would I store the already existing book in a variable?
     
  4. Mr_Simba

    Mr_Simba King of the Pridelands
    Moderator Supporter

    Joined:
    Dec 9, 2016
    Messages:
    257
    Likes Received:
    55
    Medals:
    You can just an effect command to run it in-line while you're holding the book, i.e.
    Code (Skript):
    1. set {existingBook} to player's tool
     
  5. Hibrocolomedio

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
    It's interesting. I've tryed the same thing yesterday as what you suggested, now it is working.
     
  6. LimeGlass

    Supporter Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    605
    Likes Received:
    419
    Medals:
  7. Hibrocolomedio

    Joined:
    Dec 14, 2017
    Messages:
    18
    Likes Received:
    0
Thread Status:
Not open for further replies.
Loading...