Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @name
- @inputs
- @outputs
- @persist O:entity E:entity On
- @trigger
- interval(100)
- if(first())
- {
- E = entity()
- O = owner()
- E:propGravity(0)
- E:propFreeze(0)
- E:propNotSolid(1)
- On = 1
- }
- if(On)
- {
- local Direction = vec(0)
- if(O:keyForward())
- {
- Direction +=E:forward()
- }
- if(O:keyBack())
- {
- Direction -=E:forward()
- }
- if(O:keyRight())
- {
- Direction +=E:right()
- }
- if(O:keyLeft())
- {
- Direction +=E:right()
- }
- if(O:keyJump())
- {
- Direction +=E:up()
- }
- if(O:keyDuck())
- {
- Direction -=E:up()
- }
- E:applyForce((Direction - E:velL())* E:mass())
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement