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

Problems in onHealthChange

Huntre

Member
Joined
Mar 22, 2011
Messages
70
Solutions
1
Reaction score
8
Well I'm trying to put in tfs 1.3 for the player with a summoned bug not receiving damage but not going I already added the event in login.lua and will not anyone can help?


In login.lua is this way player:registerEvent("SemDano").

Code:
function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin)
 if isPlayer(creature) and creature:getSummons()[1] then
  return false                                                                          
 end
  return true
end
 
first return is primaryDamage
second return value is primaryType

what you want to return is 0
not false

false just means keep it same i think.
 
But the problem is that it does not go in if

Code:
 if  creature:isPlayer() then
  print("Entrou no IF")
  return false end
 
I apologize for the error I made as I implemented this code at dawn I think I was sleeping so my error was tag in xml I should have already seen this more. Can close selected.
 
Back
Top