seems to be not working..doPlayerSetMaxHealth(cid, getPlayerMaxHealth(cid)+5)
function onUse(cid, item, fromPosition, itemEx, toPosition)
local health = 2 -- amount of health to get per use
local cost = 1000 -- amount to pay per use
local add = getCreatureMaxHealth(cid) + health
if isPlayer(cid) and getPlayerMoney(cid) > cost then
if doPlayerRemoveMoney(cid, cost) == true then
setCreatureMaxHealth(cid, add)
else
doPlayerSendTextMessage(cid,25,"You dont have enough money to purchase this")
end
end
return true
end
No offense but...Enjoy.
LUA:function onUse(cid, item, fromPosition, itemEx, toPosition) local health = 2 -- amount of health to get per use local cost = 1000 -- amount to pay per use local add = getCreatureMaxHealth(cid) + health if isPlayer(cid) and getPlayerMoney(cid) > cost then if doPlayerRemoveMoney(cid, cost) == true then setCreatureMaxHealth(cid, add) else doPlayerSendTextMessage(cid,25,"You dont have enough money to purchase this") end end return true end
local health = 5
local add = getCreatureMaxHealth(cid) + 5
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(cid) then
doRemoveItem(cid, item.uid)
setCreatureMaxHealth(cid, add)
end
return true
end
and it is possible that when you kill a monster, give you 5 + hp permamently?
local t = {
m = "Rat",
hp = 5
}
function onKill(cid, target)
if not isPlayer(target) and getCreatureName(target) == t.m then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+t.hp)
end
return TRUE
end
LUA:local t = { m = "Rat", hp = 5 } function onKill(cid, target) if not isPlayer(target) and getCreatureName(target) == t.m then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+t.hp) end return TRUE end
setCreatureMaxMana(cid, getCreatureMaxMana+t.hp)thanks, and add mana permamently is possible?
local t = {
m = "Rat",
hp = 60
mana = 120
}
function onKill(cid, target)
if not isPlayer(target) and getCreatureName(target) == t.m then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+t.hp)
setCreatureMaxMana(cid, getCreatureMaxMana+t.mana)
end
return TRUE
end
local t = {
m = "Rat",
hp = 60,
mana = 120
}
function onKill(cid, target)
if not isPlayer(target) and getCreatureName(target) == t.m then
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+t.hp)
setCreatureMaxMana(cid, getCreatureMaxMana+t.mana)
end
return TRUE
end