Jump to content

Crouch 1.0.1

   (3 reviews)

1 Screenshot

About This File

Lets you crouch by pressing CTRL.

 

Installing

  • Put the files you downloaded in their respective places
  • Add require('crouch') to client_packages/index.js
  • All done

 

Notes

  1. Since both this script and walking styles script uses setMovementClipset and resetMovementClipset, they probably won't work at the same time.
  2. Crouching is synced between players.

What's New in Version 1.0.1   See changelog

Released

Replaced entityDataChange with addEventHandler.

  • Like 5
  • Mask 1

User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

hubba

   1 of 1 member found this review helpful 1 / 1 member

great , now i can sneaking........

Link to review
MyNameIsJeff

· Edited by MyNameIsJeff

  

Simple, straight to the point. Thank you!

I've added command functionality if anyone was looking to include it under as one.

PLACE INTO index.js in "client_packages"

// USE /CROUCH TO TOGGLE CROUCH
mp.events.add("playerCommand", (command) => {
    const args = command.split(/[ ]+/);
    const commandName = args[0];
    if (commandName === 'crouch'){
        mp.events.callRemote("toggleCrouch");
    }
});


You MIGHT get some errors on the server side index.js, so if that's the case, just add "data" to the parameters within the function:

mp.events.add("playerDeath", (player, data) => {
    player.data.isCrouched = false;
});

mp.events.add("toggleCrouch", (player, data) => {
    if (player.data.isCrouched === undefined) {
        player.data.isCrouched = true;
    } else {
        player.data.isCrouched = !player.data.isCrouched;
    }
});

 

Link to review
×
×
  • Create New...