• 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 onCastSpell - sending to param

Cadyan

Well-Known Member
Joined
Mar 30, 2008
Messages
845
Reaction score
63
TFS 1.0
This returns the creature not being found. What is the correct way to do it?

function onCastSpell(cid, var)
doTargetCombatHealth(0, getPlayerByName(param), COMBAT_HEALING, 1, 5, CONST_ME_HOLYAREA)
return true
end
 
Last edited:
Param isen't indexed, you only have cid and var that you can use atm, param:getName() would not work.
 
Code:
function onTargetCreature(cid, target)
   if target and isPlayer(target) then
     -- what it should do
   end
   return true
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

This will effect targets that will be hit by the combat, target is the monster/player that will be hit by the combat, cid the the person who casts the spell.
 
Back
Top