Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. @name
  2. @inputs
  3. @outputs
  4. @persist O:entity E:entity On
  5. @trigger
  6. interval(100)
  7. if(first())
  8. {
  9. E = entity()
  10. O = owner()
  11. E:propGravity(0)
  12. E:propFreeze(0)
  13. E:propNotSolid(1)
  14.  
  15. On = 1
  16. }
  17.  
  18. if(On)
  19. {
  20. local Direction = vec(0)
  21. if(O:keyForward())
  22. {
  23. Direction +=E:forward()
  24. }
  25. if(O:keyBack())
  26. {
  27. Direction -=E:forward()
  28. }
  29. if(O:keyRight())
  30. {
  31. Direction +=E:right()
  32. }
  33. if(O:keyLeft())
  34. {
  35. Direction +=E:right()
  36. }
  37. if(O:keyJump())
  38. {
  39. Direction +=E:up()
  40. }
  41. if(O:keyDuck())
  42. {
  43. Direction -=E:up()
  44. }
  45.  
  46. E:applyForce((Direction - E:velL())* E:mass())
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement