Hope this isn't hard...

MrMessyHair

Noob in BLua
Hello, hope you have a good day. How to spawn dust when the player has landed from a specific height? like -50*FRACUNIT for example
 
You can't really do it based on height, but you can easily check for their downward momentum.
In pseudo-code, it would sound a bit like this:

Hook PlayerThink, with player:
  • Check if player meets the conditions to be affected by our changes (playing as the right character, etc.)
  • If not defined yet, define a variable to store player's "previous" Z momentum for comparison. Say... player.prevmomZ. We'll need it.
  • If player has landed (here's one way to check that), and player.prevmomZ (IMPORTANT: account for flipped gravity here!) is less than, say, -16*FRACUNIT...
  • Update player.prevmomZ for the next tic.
End hook.
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top