Advertisement
Chronos_Ouroboros

Sprint system

Jun 25th, 2014
320
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. script "FDSprintSystem" ENTER {
  2. if (GameType () == Game_Title_Map) Terminate;
  3. int Sprinting, tics, OldSpeed = 0;
  4. While (TRUE) {
  5. if (CheckInventory ("SprintWeapon") && Sprinting == 0) {
  6. SetActorProperty (0, APROP_Speed, OldSpeed);
  7. DisableWeapon ("SprintWeapon");
  8. Sprinting = 0;
  9. tics = 0;
  10. }
  11. if (keyDown (BT_USER1) && Sprinting == 0 && CheckInventory ("FDStamina") >= 5) {
  12. DisableWeapon ("SprintWeapon");
  13. Sprinting = 1;
  14. OldSpeed = GetActorProperty (0, APROP_Speed);
  15. }
  16. if (keyUp (BT_USER1) && Sprinting == 1) {
  17. SetActorProperty (0, APROP_Speed, OldSpeed);
  18. DisableWeapon ("SprintWeapon");
  19. Sprinting = 0;
  20. tics = 0;
  21. }
  22. if (Sprinting == 1 && CheckInventory ("Sprinting")) {
  23. if (CheckInventory ("FDStamina") >= 5)
  24. {
  25. if (tics == 5 && CheckInventory ("Sprinting")) {
  26. tics = 0;
  27. if (!CheckInventory("PowerAgilityRune") && GetVelocity () > 0)
  28. TakeInventory ("FDStamina", 5);
  29. }
  30. if (CheckInventory ("FDStamina") < 5) {
  31. SetActorProperty (0, APROP_Speed, OldSpeed);
  32. DisableWeapon ("SprintWeapon");
  33. TakeInventory ("Sprinting", 1);
  34. Sprinting = 0;
  35. tics = 0;
  36. }
  37. if (CheckInventory ("Sprinting") && ((abs (GetPlayerInput (-1, INPUT_FORWARDMOVE)) > 6400) || (abs (GetPlayerInput(-1, INPUT_SIDEMOVE)) > 6400)))
  38. SetActorProperty (0, APROP_Speed, 1.6);
  39. else
  40. SetActorProperty (0, APROP_Speed, 2.6);
  41. }
  42. }
  43. Delay (1);
  44. if (Sprinting == 1)
  45. tics++;
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement