Advertisement
Guest User

Untitled

a guest
Nov 30th, 2016
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. class MyMod : Script
  2. {
  3. bool checkOnGround = false;
  4. Vector3 originalRotation;
  5.  
  6. public MyMod()
  7. {
  8. KeyUp += MyMod_KeyUp;
  9. Tick += MyMod_Tick;
  10. }
  11.  
  12. private void MyMod_KeyUp(object sender, KeyEventArgs e)
  13. {
  14. if (e.KeyCode == Keys.T)
  15. {
  16. //your other code
  17. originalRotation = Game.Player.Character.Rotation;
  18. checkOnGround = true;
  19. }
  20. }
  21.  
  22. private void MyMod_Tick(object sender, System.EventArgs e)
  23. {
  24. if (checkOnGround && Game.Player.Character.HeightAboveGround < 0.1f) //touching ground
  25. {
  26. //do stuff with originalRotation variable
  27. checkOnGround = false;
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement