Solved Looking for help with a pass system

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

Acidic

Member
Feb 12, 2024
10
0
1
24
Hey,

I have been working on a skript where if you have a piece of paper named "Pass", you have to right click an observer at a specific x, y, and z coordinate, and it will teleport you somewhere else. I have encountered some issues, aswell as I have a few questions. My current code is shown below.

My code:
Code:
on rightclick on observer:
location of event-block is location(0, -60, 0, world)
   if player is holding paper named "ᴘᴀѕѕ":
      teleport player to location(9.500, -60.00000, -10.500, world)

Issue 1.) Basicially, the main issue is that it doesn't teleport you to the location I chose when you right click the observer.

Issue/Question 2.) I need to find out how to use gradients in skript. I looked online and it said to download skBee, which I did, but it still didn't work. There was just an invalid use of quotes error. (p.s. I used the minimessage format to make the gradient).

Issue/Question 3.) I also need to make it so you cannot rename, craft with, or disenchant, the paper. (Buit it can't be that all paper cannot be modified, just this specific pass)


This post may require some back and forth, because I am not very experienced with skript, as I have just begun learning skript around a month ago. Thank you to anyone who helps, and I'm looking forward to your response.
 
Try this :emoji_slight_smile:
Code:
on rightclick on observer:
    location of event-block is location(0, -60, 0, world "world")
    player is holding paper named "ᴘᴀѕѕ"
    teleport player to location(9.500,-60.00000,-10.500, world "world")
 
Hey,

Unfortunately the code did not work. If I were to remove the "location of event-block is location(0, -60, 0, world "world")" on line 2, the code would work flawlessly. Are there any other ideas you or anyone else may have regarding this? I'm pretty sure the coordinates are the issue but I need them to be on that block exactly, so I'm not entirely sure how to fix this.
 
I have an idea.

Code:
command /passTool:
    permission: observer.pass.tool
    trigger:
        give player end rod named "&7Pass Tool"

on right-click:
    event-block is observer
    player's tool is end rod named "&7Pass Tool"
    set {passlocation} to event-block

on rightclick on observer:
    
    event-block is {passlocation}
    player is holding paper named "ᴘᴀѕѕ"
    teleport player to location(9.500,-60.00000,-10.500, world "world")
 
Hey,

Great news, the code works extremely well. Thank you so much for your help! Do you have any idea of how to fix my other two issues? (Gradients, and the ability not to craft, disenchant, or rename the pass paper).
 
You can set an NBT tag to the paper so it doesnt matter if its renamed or anything.
You will need skBee for this.
Im not testing these or researching them so tell me any errors

Code:
on load:
    set {passpaper} to paper named "ᴘᴀѕѕ"
    set string tag "pass" of {passpaper} to "paper"


command /passTool:
    permission: observer.pass.tool
    trigger:
        give player end rod named "&7Pass Tool"

command /passPaper:
    permission: get.passpaper
    trigger:
        give player {passpaper}

on right-click:
    event-block is observer
    player's tool is end rod named "&7Pass Tool"
    set {passlocation} to event-block

on rightclick on observer:
    
    event-block is {passlocation}
    player's tool is paper
    set {_tag} to string tag "pass" of player's tool
    {_tag} is "paper"
    teleport player to location(9.500,-60.00000,-10.500, world "world")
 
You can set an NBT tag to the paper so it doesnt matter if its renamed or anything.
You will need skBee for this.
Im not testing these or researching them so tell me any errors

Code:
on load:
    set {passpaper} to paper named "ᴘᴀѕѕ"
    set string tag "pass" of {passpaper} to "paper"


command /passTool:
    permission: observer.pass.tool
    trigger:
        give player end rod named "&7Pass Tool"

command /passPaper:
    permission: get.passpaper
    trigger:
        give player {passpaper}

on right-click:
    event-block is observer
    player's tool is end rod named "&7Pass Tool"
    set {passlocation} to event-block

on rightclick on observer:
   
    event-block is {passlocation}
    player's tool is paper
    set {_tag} to string tag "pass" of player's tool
    {_tag} is "paper"
    teleport player to location(9.500,-60.00000,-10.500, world "world")
Oh I forgot, gradients you can use like "<##292525>P<##706E6E>a<##B8B6B6>s<##FFFFFF>s", use this website to make gradients, set the type to chat abd replace the #s with ##s
 
An error popped up. I attached the photo to it.
 

Attachments

  • Screenshot 2024-02-14 214918.png
    Screenshot 2024-02-14 214918.png
    49.4 KB · Views: 20
Code:
on load:
    set {passpaper} to paper named "ᴘᴀѕѕ"
    set tag "pass" of {passpaper} to "paper"


command /passTool:
    permission: observer.pass.tool
    trigger:
        give player end rod named "&7Pass Tool"

command /passPaper:
    permission: get.passpaper
    trigger:
        give player {passpaper}

on right-click:
    event-block is observer
    player's tool is end rod named "&7Pass Tool"
    set {passlocation} to event-block

on rightclick on observer:
    
    event-block is {passlocation}
    player's tool is paper
    set {_tag} to tag "pass" of player's tool
    {_tag} is "paper"
    teleport player to location(9.500,-60.00000,-10.500, world "world")
 
Two new errors; same as before and a new error:
 

Attachments

  • Screenshot 2024-02-14 220843.png
    Screenshot 2024-02-14 220843.png
    97.5 KB · Views: 27
To fix your issue:

[Line 3] set tag "pass" of nbt of {passpaper} to (nbt compound from "Paper:1b")
[Line 25] set {_tag} to tag "pass" of nbt of player's held item
 
Hey,

Thank you very much, it worked. For gradients, I tried out what VeryGoodSand said to use gradients, but I had no success. Do you have any other ideas or things you think I'm missing when trying to make my item named with gradients?
 
Nevermind, I have solved the gradient issue. Thank you for both of your help!