fork download
  1. // NBA 2K25 Vibration on Shot Release with Menu
  2. // This script adds a vibration effect on shot release and allows for menu adjustments
  3.  
  4. define SHOOT_BUTTON = PS4_R1; // Change this to your shoot button (e.g., PS4_R1, XB_RB)
  5. define MENU_BUTTON = PS4_TOUCHPAD; // Button to open the menu
  6. define INCREASE_BUTTON = PS4_L3; // Button to increase vibration duration
  7. define DECREASE_BUTTON = PS4_L2; // Button to decrease vibration duration
  8.  
  9. int vibrationDuration = 100; // Default vibration duration in milliseconds
  10. int menuOpen = 0;
  11.  
  12. void main {
  13. // Check if the shoot button is pressed
  14. if (get_val(SHOOT_BUTTON)) {
  15. // Trigger shot release vibration
  16. set_val(PS4_R2, 100); // Start vibration
  17. wait(vibrationDuration); // Wait for the specified duration
  18. set_val(PS4_R2, 0); // Stop vibration
  19. }
  20.  
  21. // Menu Navigation
  22. if (get_val(MENU_BUTTON)) {
  23. menuOpen = !menuOpen; // Toggle menu state
  24. wait(500); // Debounce wait
  25. }
  26.  
  27. if (menuOpen) {
  28. displayMenu();
  29. }
  30. }
  31.  
  32. void displayMenu() {
  33. // Display current vibration duration for a short period
  34. combo_run(menuDisplay);
  35. }
  36.  
  37. combo menuDisplay {
  38. // Visual feedback
  39. set_val(PS4_L3, 100);
  40. wait(1000); // Wait to allow player to see the display
  41. set_val(PS4_L3, 0); // Clear display
  42. wait(100); // Small delay before next input
  43.  
  44. // Adjust vibration duration based on button input
  45. if (get_val(INCREASE_BUTTON)) {
  46. vibrationDuration += 10; // Increase duration
  47. wait(200); // Wait to prevent rapid increment
  48. }
  49. if (get_val(DECREASE_BUTTON)) {
  50. vibrationDuration -= 10; // Decrease duration
  51. wait(200); // Wait to prevent rapid decrement
  52. }
  53.  
  54. // Clamp the duration to a reasonable range
  55. if (vibrationDuration < 10) vibrationDuration = 10; // Minimum duration
  56. if (vibrationDuration > 500) vibrationDuration = 500; // Maximum duration
  57. }
  58.  
Success #stdin #stdout 0.02s 25644KB
stdin
Standard input is empty
stdout
// NBA 2K25 Vibration on Shot Release with Menu
// This script adds a vibration effect on shot release and allows for menu adjustments

define SHOOT_BUTTON = PS4_R1; // Change this to your shoot button (e.g., PS4_R1, XB_RB)
define MENU_BUTTON = PS4_TOUCHPAD; // Button to open the menu
define INCREASE_BUTTON = PS4_L3; // Button to increase vibration duration
define DECREASE_BUTTON = PS4_L2; // Button to decrease vibration duration

int vibrationDuration = 100; // Default vibration duration in milliseconds
int menuOpen = 0;

void main {
    // Check if the shoot button is pressed
    if (get_val(SHOOT_BUTTON)) {
        // Trigger shot release vibration
        set_val(PS4_R2, 100); // Start vibration
        wait(vibrationDuration); // Wait for the specified duration
        set_val(PS4_R2, 0); // Stop vibration
    }

    // Menu Navigation
    if (get_val(MENU_BUTTON)) {
        menuOpen = !menuOpen; // Toggle menu state
        wait(500); // Debounce wait
    }

    if (menuOpen) {
        displayMenu();
    }
}

void displayMenu() {
    // Display current vibration duration for a short period
    combo_run(menuDisplay);
}

combo menuDisplay {
    // Visual feedback
    set_val(PS4_L3, 100);
    wait(1000); // Wait to allow player to see the display
    set_val(PS4_L3, 0); // Clear display
    wait(100); // Small delay before next input

    // Adjust vibration duration based on button input
    if (get_val(INCREASE_BUTTON)) {
        vibrationDuration += 10; // Increase duration
        wait(200); // Wait to prevent rapid increment
    }
    if (get_val(DECREASE_BUTTON)) {
        vibrationDuration -= 10; // Decrease duration
        wait(200); // Wait to prevent rapid decrement
    }

    // Clamp the duration to a reasonable range
    if (vibrationDuration < 10) vibrationDuration = 10; // Minimum duration
    if (vibrationDuration > 500) vibrationDuration = 500; // Maximum duration
}