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

If i death i dont loss eq and god tp me to temple ;)

xavierek

New Member
Joined
Apr 11, 2009
Messages
209
Reaction score
0
Hello i try to make script if monster or player "kill me" i dont die script teleport me to temple and add me full hp and mana ? some one made it i try to make it in onkill only have problem when monster kill me ... its dont work

TFS 0.36pl or 0.4
 
PHP:
function onStatsChange(cid, attacker, type, combat, value)
        if combat == COMBAT_HEALING then
                return true
        end

        if getCreatureHealth(cid) > value then
                return true
        end


            
              
       
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
        doSendMagicEffect(getCreaturePosition(cid), 10)
       
        doRemoveConditions(cid)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
        return false

end

i give it in mod and its dont work :(
 
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Team Event" version="1.0" author="Xavier" contact="[email protected]" enabled="yes">
<event type="statschange" name="Arena" event="script"><![CDATA[
function onStatsChange(cid, attacker, type, combat, value)
        if combat == COMBAT_HEALING then
                return true
        end

        if getCreatureHealth(cid) > value then
                return true
        else


            
              
       
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
        doSendMagicEffect(getCreaturePosition(cid), 10)
       
        doRemoveConditions(cid)
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
        return false
end
end

]]></event>
</mod>
 
well..

[cpp]
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) and isMonster(mostDamageKiller) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)), 10)
return false
end
return true
end
[/cpp]
 
dont work :p

<event type="preparedeath" name="dd" event="script" value="dd.lua"/>


function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if isPlayer(cid) and isMonster(mostDamageKiller) then
doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doSendMagicEffect(getTownTemplePosition(getPlayerTown(cid)), 10)
return false
end
return true
end


and i do in login.lua too :p
 
no error im reading on forum and ther says to change it to onStatsChange() only its dont work to xD
 
Lua:
function onStatsChange(cid, attacker, type, combat, value) 
        if getCreatureHealth(cid)-value <= 0 then 
        doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) 
        doSendMagicEffect(getCreaturePosition(cid), 10) 
        doRemoveConditions(cid) 
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) 
        doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid)) 
        return false 
     end
return true 
end
 
DONE !!

PHP:
function onStatsChange(cid, attacker, type, combat, value)
        if combat == COMBAT_HEALING then
			return true
        end
        if getCreatureHealth(cid) > value then
			return true
        end
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), FALSE)
		doSendMagicEffect(getCreaturePosition(cid), 10)
		doRemoveConditions(cid, FALSE)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
		doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
		return false
end
 
Back
Top