Code:
doSummonMonster(cid,"Healing Totem")
summons = getCreatureSummons(cid)
for i=1,#summons do
if(getCreatureName(summons[i])=="Healing Totem") then
local totem = summons[i]
end
end
doSendMagicEffect(getCreaturePosition(totem),CONST_ME_CARNIPHILA)
setCreatureMaxHealth(totem,getPlayerLevel(cid)*10+150)
doCreatureAddHealth(totem,getPlayerLevel(cid)*10+50)
I'm getting the error "Creature not found" for getCreaturePosition, setCreatureMaxHealth and doCreatureAddHealth (I guess because totem stays as a nil value).
How is it possible that the creature I just summoned a line ago doesn't make getCreatureName(summons)=="Healing Totem") return true? (The name of the creature ingame is "Healing Totem", too)
I guess I'm missing something really obvious, but I've been looking for hours now and I can't fix it.
Help is very much appreciated