• 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!

Put Together This Scripts [HELP]

Zarabustor

Human Being
Joined
Sep 10, 2009
Messages
186
Reaction score
0
Location
Cancun, Mexico
Hi i want to put together this scripts, i mean that will work as 1 item that will give you mana and health and some attack speed.
Could you please help me?

Health Booster:
Code:
  local cfg =
{
    level = 30000,
    itemid = 7443,
    newHealth = 150000
}
local storage = 14570
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if (item.itemid == cfg.itemid) then
        if getPlayerLevel(cid) >= cfg.level then
            if getPlayerStorageValue(cid, storage) == -1 then
                setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+cfg.newHealth))
                setPlayerStorageValue(cid, storage, 1)
                doSendAnimatedText(getCreaturePosition(cid), "HEALTH!",TEXTCOLOR_RED)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved ".. cfg.newHealth .." extra health points, now your health is ".. getCreatureMaxHealth(cid) .."!") 
                doRemoveItem(item.uid)
            else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may only use one health booster.")
		      doSendMagicEffect(getPlayerPosition(cid), 2) 
            end
        else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your need level 30,000k!! to use this booster.")
		      doSendMagicEffect(getPlayerPosition(cid), 2) 
        end
        return TRUE
    end
end

Mana Booster:

Code:
  local cfg =
{
    level = 30000,
    itemid = 7439,
    newMana = 150000
}
local storage = 14565
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if (item.itemid == cfg.itemid) then
        if getPlayerLevel(cid) >= cfg.level then
            if getPlayerStorageValue(cid, storage) == -1 then
                setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))
                setPlayerStorageValue(cid, storage, 1)
                doSendAnimatedText(getCreaturePosition(cid), "MANA!",TEXTCOLOR_PURPLE)
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved ".. cfg.newMana .." extra mana points, now your mana is ".. getCreatureMaxMana(cid) .."!") 
                doRemoveItem(item.uid)
            else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may only use one mana booster.")
		      doSendMagicEffect(getPlayerPosition(cid), 2) 
            end
        else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your need level 30,000k!! to use this booster.")
		      doSendMagicEffect(getPlayerPosition(cid), 2) 
        end
        return TRUE
    end
end
 
LUA:
 local cfg = {
	level = 30000,
	newHealth = 150000,
	newMana = 150000,
	storage = 14570,
	text = "Boost!"
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if getPlayerLevel(cid) >= cfg.level then
		if getPlayerStorageValue(cid, cfg.storage) == -1 then
			setCreatureMaxHealth(cid, (getCreatureMaxHealth(cid)+cfg.newHealth))
			setCreatureMaxMana(cid, (getCreatureMaxMana(cid)+cfg.newMana))			
			setPlayerStorageValue(cid, cfg.storage, 1)
			doSendAnimatedText(getCreaturePosition(cid), cfg.text,TEXTCOLOR_RED)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved ".. cfg.newHealth .." extra health/mana points, now your health is ".. getCreatureMaxHealth(cid) .."/ your mana is ".. getCreatureMaxMana(cid) .."!") 
			doRemoveItem(item.uid)
		else
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You may only use one Mega booster.")
		       doSendMagicEffect(getPlayerPosition(cid), 2) 
                end
        else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your need level 30,000k!! to use this booster.")
		doSendMagicEffect(getPlayerPosition(cid), 2) 
        end
        return TRUE
end
 
Back
Top