Check if player is around location variable.

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

Status
Not open for further replies.

Whiskey

Member
Feb 12, 2021
1
0
1
So I basically want to check if a player has moved from a certain block location with Skript and I don't really know how to do that.

Code:
on rightclick:
    if clicked block is grass block:
        set {testlocation} to location of event-block
        wait 3 seconds
        if player is in radius 200 of {testlocation}:
            message "yes"
        else:
            message "no"

I would love to know if I'm able to do something like what I just sent. Any help is appreciated <3
 
Firstly, in just a single command/event/function etc., use variables starting with _
Secondly, this should work:
Code:
on right click:
    clicked block is grass block
    set {_l} to location of clicked block
    wait 3 seconds
    if distance between player's location and {_l} <= 200:
        send "Yep!"
 
Status
Not open for further replies.