Skip to main content

Player::setModel

Client-side function

JavaScript​

Required Params​

  • modelName: string — The name of the model to be set for the player.

Return value​

  • void — This function does not return a value.

Syntax​

// Function to change the player's model
function changePlayerModel(modelName) {
let player = mp.players.local; // Reference to the local player
let modelHash = mp.game.joaat(modelName); // Get the model hash from the model name

// Set the player's model
player.model = modelHash; // Change the player's model

// Notify the player
mp.gui.chat.push("Your model has been changed to " + modelName + ".");
}

// Bind the function to a key (for example, the "E" key)
mp.keys.bind(69, false, function() { // 69 is the key code for "E"
changePlayerModel('a_m_m_acult_01'); // Call the function to change the model
});

Available Models​

See the list of available models: Peds