#Player landing

1 messages · Page 1 of 1 (latest)

thin wagon
#

is there a simple way to check if a player lands on ground? so not like checking every second if player isn't in air

light otter
#

you can check when they take damage from fall
but not regular landing

thin wagon
#

i'm currently using that way but when the player accidentally doesn't take any fall damage it can't work for me

light otter
#

what are you trying to achieve btw?

thin wagon
#

explosion on landing

#

i'm just canceling damages here and there so i'm wondering if there is simplest way

#

well

#

u can technically u could loop all players every tick and do it that way

hollow burrow
#

ooga

mint wing
thin wagon
#

yes but checking every tick infinitely

#

its not that bad for performance

light otter
#

ehh
on player move would be better

thin wagon
#

its certainly good but still

light otter
#

But that's not landing
since walking wil still trigger it

mint wing
#

it will be if u need to check blocks under player as well

thin wagon
#

there is alot bad

#

ya that's why i said a way without checking every x time

light otter
#

combine on damage from fall + a while loop in on jump checking when player is on ground: becoems true

thin wagon
#

that can work

light otter
#

the only thing this wont trigger for is walking off a 3 block edge without jumping
but it should be good enough

thin wagon
#

no that isn't needed so it's alright

light otter
#

make sure not to trigger it twice if they jump and take damage from that fall

thin wagon
#

with what i'm doing players will always take fall damage

light otter
#

well
why not just check the on damage event then?

thin wagon
#

cause i don't know sometimes the player doesn't take the damage somehow

#

so the event can't work

light otter
#

hmm
I would try to fix that xD

thin wagon
#

too small of a fall

#

how would the loop look like

#

i don't know how to start a loop from an event

#

what loop?

thin wagon
#

so when the player jumps it will start the loop to check every x time if the player is in air or ground

#

then when he lands it could stop the loop

#

so at least the loop wont work infinitely

#

while loop

light otter
#
    wait 1 tick # in case the server still sees the player on the ground
    while player is not on ground:
        wait 1 tick # can be changed depending on accuracy
    # do stuff

I guess

thin wagon
#

so if the while stops it will execute the last line right?

light otter
#

yeah

#

the loop will wait while they are in the air

#

and when it stops it will continue with the code

thin wagon
#

okay i will test it out thanks guys

#

there should be a [on] [player] land[ing] though what do you think

light otter
#

It's not in Paper

#

if paper adds it skript will too

thin wagon
#

aah didn't know about that

#

so paper is a dependency

light otter
#

if it was in paper you could use skript-reflect addon to listen to it x)

thin wagon
#

interesting

#

the whole time i was thinking skript could check events by itself

light otter
#

well it is
it's checking events that the server has
Paper is the server

thin wagon
#

i mean for all of them

light otter
#

if paper doesn;t have it, Skript can't do it xD

#

Landing is not an event

thin wagon
#

yea it's not

#

but what if the server isn't paper tho

light otter
#

Skript works on Spigot too, with some stuff being disabled
but they are pretty much the same regardless

thin wagon
#

but more things with paper right

#

i mean more events and stuff

light otter
#

yeah
paper is nice

thin wagon
#

it is

#

so i learnt something today

#

the server type is used by skript to get informations