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

Deleted member

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_language.skript:
command /help:
    trigger:
        set {_book} to a new book
        open book {_book} to player
I want to do this:
code_language.skript:
command /help:
    trigger:
        set {_book} to an already existing ingame book
        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:
 
Last edited by a moderator:
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_language.skript:
set {_bookToOpen} to a new book
loop book pages of {existingBook}:
    add page with data loop-value to {_bookToOpen}
open book {_bookToOpen} to player

Haven't used the Skellett book stuff yet so hopefully that works, or at least you get the idea!
 
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_language.skript:
set {_bookToOpen} to a new book
loop book pages of {existingBook}:
    add page with data loop-value to {_bookToOpen}
open book {_bookToOpen} to player

Haven't used the Skellett book stuff yet so hopefully that works, or at least you get the idea!
How would I store the already existing book in a variable?
 
You can just an effect command to run it in-line while you're holding the book, i.e.
code_language.skript:
set {existingBook} to player's tool
 
You can just an effect command to run it in-line while you're holding the book, i.e.
code_language.skript:
set {existingBook} to player's tool
It's interesting. I've tryed the same thing yesterday as what you suggested, now it is working.
 
Status
Not open for further replies.