ausirosiris
New Member
- Joined
- May 23, 2020
- Messages
- 57
- Reaction score
- 2
Folks, i've wrote this script it works.
The only problem is when the player is already with skull (white or yellow)
for some weird reason (idk why yet) sometimes its crashing the console and closing it.
and also its not completely healing the player after it teleports back.
Any thoughts? - Thank you in advance!
The only problem is when the player is already with skull (white or yellow)
for some weird reason (idk why yet) sometimes its crashing the console and closing it.
and also its not completely healing the player after it teleports back.
Any thoughts? - Thank you in advance!
Lua:
----- Teleport Section -----
local town = {x = 1022, y = 1023, z = 13}
----- Exp Section -----
function onStatsChange(cid, attacker, type, combat, value)
local expGain = (getPlayerLevel(cid) + 70) * 0.01 * 70 * (getPlayerLevel(cid) * getPlayerLevel(cid)) - (5 * getPlayerLevel(cid) + 8)
if type == 1 then
if getCreatureHealth(cid) <= value then
if isPlayer(cid) and isPlayer(attacker) then
doPlayerAddExperience(attacker, expGain)
doSendAnimatedText(getPlayerPosition(attacker), expGain, TEXTCOLOR_DARKRED)
----- Teleport Config -----
doTeleportThing(cid, town, true)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
----- Lose Experience -----
if getPlayerLevel(cid) > 150 then
doPlayerAddExperience(cid, (getExperienceForLevel(150) - getPlayerExperience(cid)))
end
------End of Script--------
end
end
end
return TRUE
end
Last edited: