• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Full hp & Mana

matti450

Member
Joined
Apr 13, 2008
Messages
507
Reaction score
24
Im using version 0.3.6 and want this script to work help me out guys :)


--[[
Idea by Pitufo
Script by Shawak
]]--

local config = {

healHP = 1000,
healPlayers = "yes",
healMonsters = "yes",
}

local healthArea = {

fromX = 1001,
fromY = 995,
fromZ = 7,
toX = 1009,
toY = 1002,
toZ = 7,

}

function onThink(cid, interval, lastExecution)
for x = healthArea.fromX, healthArea.toX do
for y = healthArea.fromY, healthArea.toY do
for z = healthArea.fromZ, healthArea.toZ do
local pos = {x=x, y=y, z=z, stackpos = 253}
local thing = getThingfromPos(pos)
doSendMagicEffect(pos, 12)
if thing.itemid > 0 then
if(isPlayer(thing.uid) == TRUE and string.lower(config.healPlayers) == "yes") then
doCreatureAddHealth(thing.uid, config.healHP)
if string.lower(getConfigValue("showHealingDamage")) == "yes" then
doSendAnimatedText(pos, "+"..config.healHP.."", 18)
end
elseif(isMonster(thing.uid) == TRUE and string.lower(config.healMonsters) == "yes") then
doCreatureAddHealth(thing.uid, config.healHP)
if string.lower(getConfigValue("showHealingDamageForMonsters")) == "yes" then
doSendAnimatedText(pos, "+"..config.healHP.."", 18)
end
end
end
end
end
end
return TRUE
end

when i click on blue crystal it gives me full mana and when i click on the pink crystal it give me full hp

eeeas.png
 
if u need when click on red give me hp and when click on blue give u mana so u must use action scripts not globaleevent
now go to u date/action/scripts and make new lua call fullhp
Code:
local exhaustionStorage = 2555 -- Storage value for exhastion
local HPamount = 999999999 -- amount of HP healed
local time = 1 -- Time of exhaustion (in seconds)

function onUse(cid, item, frompos, topos)
if not(exhaustion.check(cid,exhaustionStorage)) then
        doCreatureAddHealth(cid, HPamount)
        doSendMagicEffect(getCreaturePosition(cid),53)
         exhaustion.set(cid,exhaustionStorage,time)
        doSendAnimatedText(getPlayerPosition(cid), "Health", TEXTCOLOR_TEAL)
            return true
else
        doPlayerSendCancel(cid, "Can't drink any more water for now.")
        doSendMagicEffect(getCreaturePosition(cid),2)
end
return false
end

and new lua call fullmana
Code:
local exhaustionStorage = 2555 -- Storage value for exhastion
local MANAamount = 999999999 -- amount of HP healed
local time = 1 -- Time of exhaustion (in seconds)

function onUse(cid, item, frompos, topos)
if not(exhaustion.check(cid,exhaustionStorage)) then
        doCreatureAddMana(cid, MANAamount)
        doSendMagicEffect(getCreaturePosition(cid),31)
         exhaustion.set(cid,exhaustionStorage,time)
        doSendAnimatedText(getPlayerPosition(cid), "Mana", TEXTCOLOR_TEAL)
            return true
else
        doPlayerSendCancel(cid, "Can't drink any more water for now.")
        doSendMagicEffect(getCreaturePosition(cid),2)
end
return false
end
 
if u need when click on red give me hp and when click on blue give u mana so u must use action scripts not globaleevent
now go to u date/action/scripts and make new lua call fullhp
Code:
local exhaustionStorage = 2555 -- Storage value for exhastion
local HPamount = 999999999 -- amount of HP healed
local time = 1 -- Time of exhaustion (in seconds)

function onUse(cid, item, frompos, topos)
if not(exhaustion.check(cid,exhaustionStorage)) then
        doCreatureAddHealth(cid, HPamount)
        doSendMagicEffect(getCreaturePosition(cid),53)
         exhaustion.set(cid,exhaustionStorage,time)
        doSendAnimatedText(getPlayerPosition(cid), "Health", TEXTCOLOR_TEAL)
            return true
else
        doPlayerSendCancel(cid, "Can't drink any more water for now.")
        doSendMagicEffect(getCreaturePosition(cid),2)
end
return false
end

and new lua call fullmana
Code:
local exhaustionStorage = 2555 -- Storage value for exhastion
local MANAamount = 999999999 -- amount of HP healed
local time = 1 -- Time of exhaustion (in seconds)

function onUse(cid, item, frompos, topos)
if not(exhaustion.check(cid,exhaustionStorage)) then
        doCreatureAddMana(cid, MANAamount)
        doSendMagicEffect(getCreaturePosition(cid),31)
         exhaustion.set(cid,exhaustionStorage,time)
        doSendAnimatedText(getPlayerPosition(cid), "Mana", TEXTCOLOR_TEAL)
            return true
else
        doPlayerSendCancel(cid, "Can't drink any more water for now.")
        doSendMagicEffect(getCreaturePosition(cid),2)
end
return false
end
and items id in

"function onUse(cid, item, frompos, topos)" ?
 
Back
Top