Detecting Players Location

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

MykGyvr

Member
Oct 22, 2020
3
0
1
26
Hello,
Code:
every 5 seconds:
    type of event-block = {Generators::options::Generator1Block} or {Generators::options::Generator2Block} or {Generators::options::Generator3Block} or {Generators::options::Generator4Block} or {Generators::options::Generator5Block} or {Generators::options::Generator6Block} or {Generators::options::Generator7Block} or {Generators::options::Generator8Block} or {Generators::options::Generator9Block} or {Generators::options::Generator10Block} or {Generators::options::Generator11Block} or {Generators::options::Generator12Block} or {Generators::options::Generator13Block} or {Generators::options::Generator14Block} or {Generators::options::Generator15Block} or {Generators::options::Generator16Block} or {Generators::options::Generator17Block} or {Generators::options::Generator18Block} or {Generators::options::Generator19Block} or {Generators::options::Generator20Block} or {Generators::options::Generator21Block} or {Generators::options::Generator22Block} or {Generators::options::Generator23Block} or {Generators::options::Generator24Block} or {Generators::options::Generator25Block} or {Generators::options::Generator26Block} or {Generators::options::Generator27Block} or {Generators::options::Generator28Block} or {Generators::options::Generator29Block} or {Generators::options::Generator30Block} or {Generators::options::Generator31Block}
    set {_loc} to location of event-block
    set {_ploc} to location of player
    loop all players:
        if {Generators::list::%loop-player's uuid%::*} is set:
            drop 1 of bricks 0.5 meters above {Generators::location::%loop-player's uuid%::1::*} without velocity
            drop 1 of nether brick item 0.5 meters above {Generators::location::%loop-player's uuid%::2::*} without velocity
            drop 1 of wheat 0.5 meters above {Generators::location::%loop-player's uuid%::3::*} without velocity
            drop 1 of melon slice 0.5 meters above {Generators::location::%loop-player's uuid%::4::*} without velocity
            drop 1 of stick 0.5 meters above {Generators::location::%loop-player's uuid%::5::*} without velocity
            drop 1 of coal 0.5 meters above {Generators::location::%loop-player's uuid%::6::*} without velocity
            drop 1 of lapis lazuli 0.5 meters above {Generators::location::%loop-player's uuid%::7::*} without velocity
            drop 1 of iron nugget 0.5 meters above {Generators::location::%loop-player's uuid%::8::*} without velocity
            drop 1 of iron ingot 0.5 meters above {Generators::location::%loop-player's uuid%::9::*} without velocity
            drop 1 of gold nugget 0.5 meters above {Generators::location::%loop-player's uuid%::10::*} without velocity
            drop 1 of gold ingot 0.5 meters above {Generators::location::%loop-player's uuid%::11::*} without velocity
            drop 1 of diamond 0.5 meters above {Generators::location::%loop-player's uuid%::12::*} without velocity
            drop 1 of emerald 0.5 meters above {Generators::location::%loop-player's uuid%::13::*} without velocity
            drop 1 of warped fungus 0.5 meters above {Generators::location::%loop-player's uuid%::14::*} without velocity
            drop 1 of nether quartz 0.5 meters above {Generators::location::%loop-player's uuid%::15::*} without velocity
            drop 1 of book 0.5 meters above {Generators::location::%loop-player's uuid%::16::*} without velocity
            drop 1 of glowstone dust 0.5 meters above {Generators::location::%loop-player's uuid%::17::*} without velocity
            drop 1 of netherite scrap 0.5 meters above {Generators::location::%loop-player's uuid%::18::*} without velocity
            drop 1 of rotten flesh 0.5 meters above {Generators::location::%loop-player's uuid%::20::*} without velocity
            drop 1 of magma cream 0.5 meters above {Generators::location::%loop-player's uuid%::21::*} without velocity
            drop 1 of blaze powder 0.5 meters above {Generators::location::%loop-player's uuid%::22::*} without velocity
            drop 1 of nether star 0.5 meters above {Generators::location::%loop-player's uuid%::23::*} without velocity
            drop 1 of end crystal 0.5 meters above {Generators::location::%loop-player's uuid%::24::*} without velocity
            drop 1 of fire charge 0.5 meters above {Generators::location::%loop-player's uuid%::25::*} without velocity
            drop 1 of slime ball 0.5 meters above {Generators::location::%loop-player's uuid%::26::*} without velocity
            drop 1 of honeycomb 0.5 meters above {Generators::location::%loop-player's uuid%::27::*} without velocity
            drop 1 of nautilus shell 0.5 meters above {Generators::location::%loop-player's uuid%::28::*} without velocity
            drop 1 of flint 0.5 meters above {Generators::location::%loop-player's uuid%::29::*} without velocity
            drop 1 of dried kelp 0.5 meters above {Generators::location::%loop-player's uuid%::30::*} without velocity
    if {_loc} is not within 5 blocks of {_ploc}:
        cancel event

I know I more than likely have this wrong. I'm semi-new to Skript and need to know how to have this detect when players are within X Blocks from these event blocks. If anyone knows how to properly set this up it would be a huge help. Thanks.
 
Last edited:
there are no event-blocks in the event, there is no player in the event!

wouldn't it be easier to make a region and then:
Code:
loop all players:
    if loop-player is in region "your_region":
        #...
you can also make
Code:
on enter "your_region":
    #...
 
Status
Not open for further replies.