Rayeko
Programmer
- Joined
- Apr 9, 2008
- Messages
- 185
- Reaction score
- 3
Hi
Well, I made a script but I just can make it work! D:
This works like an arena.. If the player's health goes to "0" then, the player will be in rest for 4-7 seconds and then return with 85% health.
This is what I've got of the script:
The problem is that.. All is fine, except that the player don't revive. It just dies after a while u,u
I hope someone knows how to fix this xD
Well, I made a script but I just can make it work! D:
This works like an arena.. If the player's health goes to "0" then, the player will be in rest for 4-7 seconds and then return with 85% health.
This is what I've got of the script:
Code:
local returnID = 633793
local time = math.random(4,7)
function onPrepareDeath(cid, lastHitKiler, mostDamageKiller)
if getPlayerVocation(cid) == 3 or 7 then
if getPlayerStorageValue(cid, returnID) == 1 then
if getGhostLeft(cid) >= 1 then
doSetItemOutfit(cid, 459, time*1000)
doSendMagicEffect(getCreaturePosition(cid), 65)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You died ... ... Or no? You were in the arena :P ...")
setPlayerStorageValue(cid, returnID, 0)
doRemoveConditions(cid)
addEvent(doReturnPlayer, time*1000, {cid = cid})
return FALSE
else
doPlayerSendCancel(cid,"You didn't died in the arena.")
return TRUE
end
else
return TRUE
end
return TRUE
end
end
function doReturnPlayer(parameters)
cid = parameters.cid
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 1)
end
The problem is that.. All is fine, except that the player don't revive. It just dies after a while u,u
I hope someone knows how to fix this xD