Jump to content

I need help with setPedStat()


amine2

Recommended Posts

Posted

I need help with setPedStat().

When i use setPedStat() for max health to "150" then the health will be 5 and i cant set the health back to 100 or 150

(I edit the health with admin panel )

function setMaxHealth(player)
	setPedStat ( player, 24, 150 )
end
addCommandHandler("health", setMaxHealth)

 

  • Moderators
Posted
Quote

wiki:
value: the new value of the stat. It must be between 0 and 1000.

Set it to 1000 ?

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

  • Moderators
Posted
3 hours ago, amine2 said:

And how i can set the max health ?

 

 

setPedStat ( thePlayer, 24, 1000 ) -- increase upper limit to max
setElementHealth ( thePlayer, 200 ) -- fill to upper limit >> or spawn the player

 

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Create an account or sign in to comment

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...