• 01-04.05.2026 - DOUBLE EXP / SKILL EVENT!

Skrypty & Kody problem z potem i inne

Status
Zamknięty.

xadio12

Active User
Zarejestrowany
Dołączył
Kwiecień 19, 2010
Posty
57
Liczba reakcji
1
{rosi?bym o pomoc z skryptem na pota tak by dawal 50% hp/mp i okre?lona ilo?? hp/mp.
mam tu script dzia?aj?cy na pota daje full mp/hp. Pr?bowa?em ro?nych sposob?w szuka?em na forum i nic dzia?aj?cego nie znalaz?em


function onUse(cid, item, fromPosition, itemEx, toPosition)
ITEM = 2673
local storage = 50000
local wait = 0.7
if fromPosition.x ~= CONTAINER_POSITION and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = getCreatureMaxHealth(cid)
REG_MANA = getPlayerMaxMana(cid)
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'heah !', TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
exhaustion.set(cid, storage, wait)
elseif item.itemid == ITEM and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = getCreatureMaxHealth(cid)
REG_MANA = getPlayerMaxMana(cid)
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'heah !', TALKTYPE_ORANGE_1)
doRemoveItem(item.uid,1)
exhaustion.set(cid, storage, wait)
else
doPlayerSendCancel(cid, "You are exhausted.")
end
return TRUE
end

Dzi?ki. Pozdrawiam
 
Odp: problem z potem i inne

Nie ten dzia?, to skrypt lua
Kod:
function onUse(cid, item, fromPosition, itemEx, toPosition)
ITEM = 2673
local storage = 50000
local wait = 0.7
if fromPosition.x ~= CONTAINER_POSITION and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = getCreatureMaxHealth(cid)/2
REG_MANA = getPlayerMaxMana(cid)/2
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'heah !', TALKTYPE_ORANGE_1)
doRemoveItem(item.uid, 1)
exhaustion.set(cid, storage, wait)
elseif item.itemid == ITEM and exhaustion.get(cid, storage) == FALSE then
REG_HEALTH = getCreatureMaxHealth(cid)
REG_MANA = getPlayerMaxMana(cid)
doPlayerAddMana(cid, REG_MANA)
doCreatureAddHealth(cid, REG_HEALTH)
doCreatureSay(cid, 'heah !', TALKTYPE_ORANGE_1)
doRemoveItem(item.uid,1)
exhaustion.set(cid, storage, wait)
else
doPlayerSendCancel(cid, "You are exhausted.")
end
return TRUE
end
 
Status
Zamknięty.
Back
Do góry