Witam mam scrypt na health potion ale jak go u?yje to pisze you are exhausted i tak ca?u czas :/
Code:
function onUse(cid, item, frompos, item2, topos)
playerpos = {x=topos.x, y=topos.y, z=topos.z, stackpos=253}
player = getThingfromPos(playerpos)
ml = getPlayerMagLevel(cid)
lvl = getPlayerLevel(cid)
voc = getPlayerVocation(cid)
ex = getPlayerStorageValue(cid,4862)
r1 = math.random(100,300)
params = { [1]=cid, [2]=lvl, [3]=voc, [4]=ml }
if item2.itemid == 1 then
if item.itemid == 7636 then
doPlayerSendCancel(cid,"It is empty.")
else
if item2.uid == cid then
if ex == -1 then
doPlayerAddHealth(cid,r1)
doSendMagicEffect(playerpos,12)
addEvent(ums,1000,params)
setPlayerStorageValue(cid,4862, 1)
doTransformItem(item.uid,7636)
doSendAnimatedText(getPlayerPosition(cid), "Aaaah...", TEXTCOLOR_ORANGE)
else
doPlayerSendCancel(cid,'You are exhausted!')
doSendMagicEffect(playerpos,2)
end
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7636)
doDecayItem(splash)
end
end
else
if item.itemid == 7636 then
doPlayerSendCancel(cid,"It is empty.")
else
splash = doCreateItem(1903,item.type,topos)
doTransformItem(item.uid,7636)
doDecayItem(splash)
end
end
return 1
end
function ums(params)
cid = params[1]
setPlayerStorageValue(cid,4862, -1)
end