hey, i read this on another post, but it wont work because I dont have a global.lua in tfs 0.3+
Im supposed to put this in global.lua (which tfs 0.3 doesnt have)
then use this
So is there any way of making this work? thanks in advance.
Im supposed to put this in global.lua (which tfs 0.3 doesnt have)
Code:
--Remove health/mana by percentages: Evil Hero(Zeriikler:Changed few things)
function doPlayerAddManaPercent(cid, percent)
local mana = getPlayerMaxMana(cid)
doPlayerAddMana(cid, (mana / 100) * percent)
return TRUE
end
function doPlayerAddHealthPercent(cid, percent)
local health = getCreatureMaxHealth(cid)
doCreatureAddHealth(cid, (health / 100) * percent)
return TRUE
end
function doPlayerRemoveManaPercent(cid, percent)
local mana = getPlayerMaxMana(cid)
doPlayerRemoveMana(cid, (mana / 100) * percent)
return TRUE
end
function doPlayerRemoveHealthPercent(cid, percent)
local health = getCreatureMaxHealth(cid)
doPlayerRemoveHealth(cid, (health / 100) * percent)
return TRUE
end
--Remove HP/MANA
function doPlayerRemoveHealth(cid, hp)
doCreatureAddHealth(cid, -hp)
return TRUE
end
function doPlayerRemoveMana(cid, mana)
doPlayerAddMana(cid, -mana)
return TRUE
end
then use this
Code:
function onStepIn(cid, item, pos)
if item.actionid == 1029 then
doRemoveHealthPercent(cid,85)
doRemoveManaPercent(cid,85)
end
return 1
end
So is there any way of making this work? thanks in advance.