Hey everyone!
This is my hp booster script... a ppl ingame cant use it and if i try to use it i get an error in console...
This is the error in console:
This is my hp booster script... a ppl ingame cant use it and if i try to use it i get an error in console...
PHP:
local cfg =
{
level = 1000,
itemid = 7439,
newMana = 150000,
storage = 89784
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) < cfg.level then
return doPlayerSendCancel(cid, "Your level is not high enough.")
elseif getPlayerStorageValue(cid, cfg.storage) >= 1 then
return doPlayerSendCancel(cid, "you can only use this item only once.")
end
setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+cfg.newHealth))
doSendAnimatedText(getCreaturePosition(cid), "HP!",TEXTCOLOR_RED)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
setPlayerStorageValue(cid, cfg.storage, 1)
doCreatureSay(cid, "You have recieved ".. cfg.newHealth .." extra hp points, now your hp is ".. getCreatureMaxHealth(cid) .."!", TALKTYPE_ORANGE_1)
doRemoveItem(item.uid)
return true
end
This is the error in console: