Hello i got script:
Is there any way to do that Player get storage [setPlayerStorageValue(cid,72009,1)] only if he take 5% (or some dmg like 300+) or more hp from monster? If he take less than 5% hp he didn't get teleported and he will get local message2
Lua:
function onKill(cid, target)
registerCreatureEvent(cid, "DiseasedDeaths")
local creaturename = getCreatureName(target)
local doEffect = CONST_ME_MAGIC_GREEN
local message = "Gratz You kill Him!."
local message2 = "You are to weak."
local tp1 = {x=1031,y=1022,z=7}
if isPlayer(cid) == TRUE then
if creaturename == 'Diseased Bill' then
doSendMagicEffect(getPlayerPosition(cid), doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid,72009,1)
doTeleportThing (cid, tp1, TRUE)
elseif creaturename == 'Diseased Fred' then
doSendMagicEffect(getPlayerPosition(cid), doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid,72010,1)
elseif creaturename == 'Diseased Dan' then
doSendMagicEffect(getPlayerPosition(cid), doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid,72011,1)
end
end
return TRUE
end
Is there any way to do that Player get storage [setPlayerStorageValue(cid,72009,1)] only if he take 5% (or some dmg like 300+) or more hp from monster? If he take less than 5% hp he didn't get teleported and he will get local message2
Last edited: