getPedStat | Multi Theft Auto: Wiki Skip to content

getPedStat

Client-side
Server-side
Shared

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 returns the value of the specified statistic of a specific ped.

Syntax

getPedStat ( )

Code Examples

server

This example announces whether a player is fat upon spawn

function checkWeightOnSpawn ( )
local stat = getPedStat ( source, 21 )
-- Check that getPedStat returned a value
if ( stat > 500 ) then
-- Output the stat in the chat box
outputChatBox ( getPlayerName ( source ) .. " needs to lose a bit of weight!" )
end
end
addEventHandler ( "onPlayerSpawn", getRootElement(), checkWeightOnSpawn )

See Also