• 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 Potion Problem.

WiLDTuRTLE

Member
Joined
Feb 26, 2011
Messages
478
Reaction score
5
Code:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1000))

 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local hpmax = getCreatureMaxHealth(cid)
local min = 30 -- this means 3% minimum healing
local max = 50 -- this means 5% maximum healing
local hp_add = math.random((hpmax * (min/100)), (hpmax * (max/100))) 
 
 	doCreatureAddHealth(cid, hp_add)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	return TRUE
end

How do i change this script to heal my friends too? [if use on people and heal them and not me]
 
Like this? I don't actually undertsand your problem? You want to be able to heal your friends with this potion?

LUA:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1000))

 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local hpmax = getCreatureMaxHealth(cid)
local min = 30 -- this means 3% minimum healing
local max = 50 -- this means 5% maximum healing
local hp_add = math.random((hpmax * (min/100)), (hpmax * (max/100))) 
 
 	doCreatureAddHealth(itemEx.uid, hp_add)
	doSendMagicEffect(getThingPos(itemEx.uid), CONST_ME_MAGIC_BLUE)
	doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_ORANGE_1)
	return TRUE
end
 
Back
Top