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

Ore notifier Help

Discussion in 'Skript' started by Thunder, May 14, 2022.

  1. Thunder

    Thunder New Member

    Joined:
    May 14, 2022
    Messages:
    8
    Likes Received:
    0
    I'm trying to make an ore notifier skript for a server but instead of tping to the tooltip that i click on it tp's me to the latest person that broke a block?

    so if i break 2 blocks it tpes me to the latest person that broke a block instead of the one that i clicked on

    `on break:
    if event-block contains ore:
    if player has permission "fewerskript.event.orealert":
    loop all players:
    set {-broken::emoji_stuck_out_tongue:layer's uuid} to event-block
    send "<##ff323d>&lAlert: &f%loop-player% &7has broken &f%event-block%! <tooltip:&7Click to tp to the broken block><command:/brokenblock {-%player%} >%loop-player%>&8[&fTP&8]<reset>"

    command /brokenblock <player>:
    permission: fewerskript.event.orealert
    trigger:
    set player's gamemode to spectator
    teleport player to arg-1`

    the :emoji_stuck_out_tongue: face is meant to be :: players
     
  2. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    Do you mean something like this?
    Code (Text):
    1. on break:
    2.     if event-block contains ore:
    3.         if player has permission "fewerskript.event.orealert":
    4.             loop all players:
    5.                 set {broken::%player's uuid%} to event-block
    6.                 send "<##ff323d>&lAlert: &f%loop-player% &7has broken &f%event-block%! <tooltip:&7Click to tp to the broken block><command:/brokenblock {-%player%} >%loop-player%>&8[&fTP&8]<reset>"
    7.  
    8. command /brokenblock <player>:
    9.     permission: fewerskript.event.orealert
    10.     trigger:
    11.         set player's gamemode to spectator
    12.         set {_loc} to location at {broken::%arg-1's uuid%}
    13.         teleport player to {_loc}
    Also, to insert code blocks, press on the + symbol and select "Code" and insert the code into there.
     
  3. Thunder

    Thunder New Member

    Joined:
    May 14, 2022
    Messages:
    8
    Likes Received:
    0
    The tp tooltip doesn't work there, i click on it and it just does nothing
     
  4. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    Wait to clarify, you want to tp to a player when you click on a block, if a person broke that block?
     
  5. Thunder

    Thunder New Member

    Joined:
    May 14, 2022
    Messages:
    8
    Likes Received:
    0
    Ummm sort of, I want to make it so that when someone breaks a block it tpes them to the player that broke that block by clicking on the tooltip
     
  6. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    What do you mean by tooltip?
     
  7. Thunder

    Thunder New Member

    Joined:
    May 14, 2022
    Messages:
    8
    Likes Received:
    0
    The tooltip is the thing where when you click it in the msg
    so the tooltip here is [&fTP&8]
     
  8. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    Is tooltip an item with the name [&fTP&8]?
     
  9. Thunder

    Thunder New Member

    Joined:
    May 14, 2022
    Messages:
    8
    Likes Received:
    0
    No, its in the text, the circled thing is the tooltip. So I was trying to make it so when you click that it tps you to whoever broke that block
    upload_2022-5-15_17-39-10.png th
     
  10. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    I didn't test with skunity's parser if this works or not, but i think in theory it should.
    Code (Text):
    1. on break:
    2.     if event-block contains ore:
    3.         set {broken::%player's uuid%} to event-block
    4.         send "<##ff323d>&lAlert: &f%player% &7has broken &f%event-block%! <tooltip:&7Click to tp to the broken block><command:/brokenblock %player%>&8[&fTP&8]<reset>" to all players where [input has permission "fewerskript.event.orealert"]
    5.  
    6. command /brokenblock <player>:
    7.     permission: fewerskript.event.orealert
    8.     trigger:
    9.         set player's gamemode to spectator
    10.         set {_loc} to location at {broken::%arg-1's uuid%}
    11.         teleport player to {_loc}
     
  11. Thunder

    Thunder New Member

    Joined:
    May 14, 2022
    Messages:
    8
    Likes Received:
    0
    Nope still doesnt work sadly
     
  12. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    Do you get any errors?
    EDIT:
    Also try it like this:
    Code (Text):
    1. on break:
    2.     if event-block contains ore:
    3.         set {broken::%player's uuid%} to event-block
    4.         broadcast "<##ff323d>&lAlert: &f%player% &7has broken &f%event-block%! <tooltip:&7Click to tp to the broken block><command:/brokenblock %player%>&8[&fTP&8]<reset>"
    5.  
    6. command /brokenblock <player>:
    7.     permission: fewerskript.event.orealert
    8.     trigger:
    9.         set player's gamemode to spectator
    10.         set {_loc} to location at {broken::%arg-1's uuid%}
    11.         teleport player to {_loc}
     
  13. Thunder

    Thunder New Member

    Joined:
    May 14, 2022
    Messages:
    8
    Likes Received:
    0
    nope, when i click on tp nothing happens
     
  14. BanditEagle

    BanditEagle Active Member

    Joined:
    May 3, 2021
    Messages:
    55
    Likes Received:
    0
    I think its a problem with skript, cause if you don't include the %, it works but it doesnt register <command: /brokenblock player> as the player in question, but just a player named "player". No matter what I tried, it didn't seem to work. However, using any command works, as long as % isn't included. Sorry, but im not sure how to help more. It might be worth it to create a new issue about this on the Skript Github and discuss the issue there.
     
  15. Thunder

    Thunder New Member

    Joined:
    May 14, 2022
    Messages:
    8
    Likes Received:
    0
    No worries man, Ty for all the help.
     

Share This Page

Loading...