• 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!

TFS 0.X How to Remove HP?

neravia

Member
Joined
May 25, 2022
Messages
75
Reaction score
13
Hello.
I need change function HP MAX - HP ? = 1HP.
Every time 1HP for player.
 
Last edited:
I don't understand what you want exactly. You want to remove full player's health to 1? Something like this?
Lua:
local currentHealth = getCreatureHealth(cid)
local removeHealth = currentHealth - 1
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -removeHealth, -removeHealth, CONST_ME_NONE)
 
Last edited:
I don't understand what you want exactly. You want to remove full player's health to 1? Something like this?
Lua:
local currentHealth = (getCreatureHealth(cid) - 1)
doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -currentHealth, -currentHealth, CONST_ME_NONE)

This code remove 1HP?
I need to remove for example 999 HP out of 1000 HP. And player have every time 1 HP only.

If have MAX HP 1000 - remove 999.
If have MAX HP 200 - remove 199.
If have MAX HP 500 - remove 499 etc ...
 
Back
Top