• 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 TFS 1.1 Damage percentage per player (onKill)

Andre1987n

New Member
Joined
Mar 1, 2015
Messages
5
Reaction score
0
Hello.

I want to know how to get the damage percentage that has been dealt per player on a player so the exp could be shared (percent / 100 * totalexp), the only thing I found is the following line:

local percent = damage / getCreatureMaxHealth(target)



But it dos not work ?!
Can anybody help me out ?


Your sincerely,

Andre.
 
Last edited:
i have no clue wat does this function do:
creature:getDamageMap()
but print the values you get, maybe something useful.
If not.
Make global matrix table.
Where you the key is monster ID.
Under Monster ID, make another table with playerID as keys and add the damage how much that player did to monster. (do it in onHealthChange function)
in monster onDeath function, open up the matrix table and share the monster exp depending on the % of total damage done.
 
Back
Top