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

Tiles get mana and health

Eduardo170

Well-Known Member
Joined
Jan 7, 2014
Messages
422
Solutions
3
Reaction score
67
Location
Caracas, Venezuela
I need help , I am new to that of the scripts , I would like someone to help me . I want that whole area will otorge health and mana players but I have several faults and not include it if you know where Movements , GlobalEvents or Actions .

sorry for my bad english, i only speak spanish


Code:
positions = {
             pos = {x=941,y=739,z=7}, --North west
             pos = {x=971,y=759,z=7},--South east
         }
          

function onThink(cid, interval, positions)
positions = getPlayerPosition(cid)
doCreatureAddHealth (cid, 350)
doCreatureAddMana (cid, 350)
end
 
You have to use Movements* .

Set an action ID for the tiles, e.g 21551

You gotta tell us what Tfs version are you using so that we give you a code for your tfs.
 
If you going todo globalevent, i would done something like this:

Code:
local config = {
    healthAmount = 350,
    manaAmount = 350,
    centerPosition = Position(1000, 1000, 7),
    radius = {x = 7, y = 5}
}

function onThink(interval)
    for _, spectator in ipairs(Game.getSpectators(config.centerPosition, false, true, config.radius.x, config.radius.x, config.radius.y, config.radius.y)) do
        spectator:addHealth(config.healthAmount)
        spectator:addMana(config.manaAmount)
    end

    return true
end
 
oho my fault, I didn't read good.

Sorry, yeah globalevent, because movement would heal you 1 time only.
 
Back
Top