Ore notifier Help

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

Thunder

New Member
May 14, 2022
8
0
1
24
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
 
Do you mean something like this?
Code:
on break:
    if event-block contains ore:
        if player has permission "fewerskript.event.orealert":
            loop all players:
                set {broken::%player'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
        set {_loc} to location at {broken::%arg-1's uuid%}
        teleport player to {_loc}
Also, to insert code blocks, press on the + symbol and select "Code" and insert the code into there.
 
Wait to clarify, you want to tp to a player when you click on a block, if a person broke that block?
 
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
 
The tooltip is the thing where when you click it in the msg
Do you mean something like this?
Code:
on break:
    if event-block contains ore:
        if player has permission "fewerskript.event.orealert":
            loop all players:
                set {broken::%player'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
        set {_loc} to location at {broken::%arg-1's uuid%}
        teleport player to {_loc}
Also, to insert code blocks, press on the + symbol and select "Code" and insert the code into there.
so the tooltip here is [&fTP&8]
 
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
 
I didn't test with skunity's parser if this works or not, but i think in theory it should.
Code:
on break:
    if event-block contains ore:
        set {broken::%player's uuid%} to event-block
        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"]
 
command /brokenblock <player>:
    permission: fewerskript.event.orealert
    trigger:
        set player's gamemode to spectator
        set {_loc} to location at {broken::%arg-1's uuid%}
        teleport player to {_loc}
 
Do you get any errors?
EDIT:
Also try it like this:
Code:
on break:
    if event-block contains ore:
        set {broken::%player's uuid%} to event-block
        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>"
 
command /brokenblock <player>:
    permission: fewerskript.event.orealert
    trigger:
        set player's gamemode to spectator
        set {_loc} to location at {broken::%arg-1's uuid%}
        teleport player to {_loc}
 
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.
 
Status
Not open for further replies.