• 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] Can only use 1 time per character

Maxens

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

here is my mana booster script:

l
PHP:
ocal cfg = 
{ 
	level = 1000,
	itemid = 8474,
	newMana = 150000
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (item.itemid == cfg.itemid) then
		if getPlayerLevel(cid) >= cfg.level then  
			setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))
			doSendAnimatedText(getCreaturePosition(cid), "HP!",TEXTCOLOR_RED)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
			doCreatureSay(cid, "You have recieved ".. cfg.newMana .." extra mp points, now your mp is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1)  
			doRemoveItem(item.uid)  
		else  
			doPlayerSendCancel(cid, "Your level is not high enough.")  
		end
		return TRUE
	end
end

Could you please make that the mana booster can only be used once a character?

Thanks ;)

- - - Updated - - -

BUUUMP!

Anyone knows? I give rep++
 
LUA:
local cfg =  
{  
    level = 1000, 
    itemid = 8474, 
    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
            setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana)) 
            doSendAnimatedText(getCreaturePosition(cid), "HP!",TEXTCOLOR_RED) 
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
	    setPlayerStorageValue(cid, cfg.storage, 1)
            doCreatureSay(cid, "You have recieved ".. cfg.newMana .." extra mp points, now your mp is ".. getCreatureMaxMana(cid) .."!", TALKTYPE_ORANGE_1)   
            doRemoveItem(item.uid)   
return true
end
 
Back
Top