Solved Stepping on Any 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 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.
Jul 1, 2017
22
0
0
34
Is there any way to check if a player is stepping on any block because I've tried it with the "on step" event but it says I have to choose a specific block.
 
on step works only for pressure plate and things (Im think)

You need just check with "on any move" event, and checking Block Below of player location ....
 
Thanks, but what I'm trying to do is whenever a player steps on a block that has netherrack below it they get ignited and this isn't working.
code_language.skript:
on any move:
    set block below the player to {trap}
    if block below "%{trap}%" is netherack:
        ignite the player for 2 seconds
[doublepost=1500586520,1500585934][/doublepost]Actually it's just giving me an error and saying "on any move:" isn't an event even though I have SkQuery and WildSkript
 
code_language.skript:
set {_b} to block below player#im think this is too wrong. 2 week not skripted....
if "%{_b]%" is netherrack:
    send "test?"
 
Thanks, but what I'm trying to do is whenever a player steps on a block that has netherrack below it they get ignited and this isn't working.
code_language.skript:
on any move:
    set block below the player to {trap}
    if block below "%{trap}%" is netherack:
        ignite the player for 2 seconds

Okay, so, like, the "on any movement" event will most likely lag your server because of how many times it's going to get called; however, there may not be another way to do what you're looking to do (at least not that I know).

code_language.skript:
set block below the player to {trap}

Okay, so first off, you're setting the block below the player to a variable, meaning that the block below the player will turn into whatever is in {trap}.

We'd want something of this sort:

code_language.skript:
set {_trap} to block below block below the player

Block below the player refers to the block the player is standing on- we want the block below that one. In addition, we can use local variables, where they are only accessible in the single event instance.

code_language.skript:
if block below "%{trap}%" is netherack:

In this condition, you're comparing a string with a block type, which is always going to return false. Since {_trap} is already of the type block type, we could just compare it to netherrack by itself:

code_language.skript:
if {_trap} is netherack:

So, something like this may work:

code_language.skript:
on any movement:
    set {_trap} to block below block below player
    if {_trap} is netherrack:
        send "test"
 
  • Like
Reactions: WeeabooGarbage
I just updated my SkQuery and removed WildSkript because it's unstable and what I had before is working. But thank you that is very helpful.
[doublepost=1500587613,1500587506][/doublepost]This works also.
code_language.skript:
on any move:
    if block below the block below the player is netherrack:
        ignite the player for 2 seconds
 
Status
Not open for further replies.