• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua how to add to creatures max health?

ziggy46802

Active Member
Joined
Aug 19, 2012
Messages
418
Reaction score
27
I tried

setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid) + 15) but that did not work
also tried

local bonus = (getCreatureMaxHealth(cid), + 15)
setCreatureMaxHealth(cid, bonus) but that did not work

so how do I do it???
 
Well, if in your attempts you used the functions the way you posted, it is just errors in the sistax.

Code:
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid) + 15))

This should work.
 
Last edited:
1) your first thing you showed.
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid) + 15)
You need to add 2 )) There are 3 ((( and only 2 )), you see?
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid) + 15))
Then it would work. Or,

2)local bonus = (getCreatureMaxHealth(cid), + 15)
setCreatureMaxHealth(cid, bonus)

Again you need to watch parentheses. Also you used a comma. That shouldn't be there.

local bonus = (getCreatureMaxHealth(cid) + 15)
setCreatureMaxHealth(cid, bonus)


Just posted this so you know what was needing to happen.
 
Back
Top