• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[LUA] problem with my HP Booster

Maxens

Member
Joined
Apr 9, 2009
Messages
479
Reaction score
7
Location
Germany
Hey everyone! :D

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:

rrnrf9.png
 
change your config to

Code:
local cfg =
{
level = 1000,
itemid = 7439,
newMana = 150000, 
storage = 89784,
NewHealth = 20
}
 
Why is it set to add 150k mana btw? :p

I can't see a visable problem, you will have to get someone experienced in the field to help.


-to anyone who is now like "why da fuq you post" i was asked by him to help here.
 
Lua:
local cfg =   
{   
    level = 1000,  
    itemid = 7439,  
    newHealth = 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
 
Back
Top Bottom