I want to check if the block that the player died on in grass block

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

    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!

Remppu_playz

New Member
Oct 15, 2021
6
0
1
Guys help me!
I need help with my code.
So i was trying to check if the player died on a grass block. Can you help me?

on respawn:
if "%region at player%" contains "dropperit":
if last block player touched is grass block:
teleport player to {spawn::1}
else if last block player touched is stone:
teleport player to {spawn::2}
else:
teleport player to {spawn}


dont worry the tabs didnt work its all fine can you help me
 
Hey, if you want to check block below player, why are u making it through "on respawn" event? Maybe I'm missing something or I don't understand what you want, but as far as I understand it, it will be through "on death" event like this:
Code:
on death of player:
    if "%region at victim%" contains "dropperit":
        if block below victim is grass:
            teleport victim to {spawn::1}
        if block below victim is stone:
            teleport victim to {spawn::2}
        else:
            teleport victim to {spawn}
 
Thanks bro!
Hey, if you want to check block below player, why are u making it through "on respawn" event? Maybe I'm missing something or I don't understand what you want, but as far as I understand it, it will be through "on death" event like this:
Code:
on death of player:
    if "%region at victim%" contains "dropperit":
        if block below victim is grass:
            teleport victim to {spawn::1}
        if block below victim is stone:
            teleport victim to {spawn::2}
        else:
            teleport victim to {spawn}
Thanks bro!