setPedStat | Multi Theft Auto: Wiki Skip to content

setPedStat

Client-side
Server-side
Shared
Needs checking

Things like infinite run, fire proof CJ, 150 armor have special activation flags. They need a way to be triggered on/off.

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function allows you to set the value of a specific statistic for a ped. Visual stats (FAT and BODY_MUSCLE) can only be used on the CJ skin, they have no effect on other skins. When this function is used client-side, it can only be used on client-side created peds.

Syntax

setPedStat ( )

Code Examples

server

This example allows a player to type the command 'beefcake' to change his player's BODY_MUSCLE stat (#23) to the maximum value of 1000. This will result in him looking really muscular.

function changeBodyStrength(thePlayer, commandName)
-- Output whether the setPlayerStat was successful in changing the BODY_MUSCLE STAT
if setPedStat(thePlayer, 23, 1000) then
outputChatBox("Your player looks really muscular")
else
outputChatBox("Failed to make your player look muscular.")
end
end
addCommandHandler("beefcake", changeBodyStrength)

See Also