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

doAreaCombatHealth creature

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,719
Solutions
9
Reaction score
339
Hello, I was testing a few system for my server and appers an error with doAreaCombatHealth creature..

### doAreaCombatHealth

klrnaOEm.png


Line that can't kill the player by using creature.uid
Code:
doAreaCombatHealth(creature.uid, COMBAT_HOLYDAMAGE, randfire,randfire, -9999, -1000000,7)

I suppost replace this line with what?

And I want that script https://otland.net/threads/tfs-1-0-lottery-system.213250/#post-2045038 didn't gave items for gamemaster, what I suppost modificy?

Thanks.
 
Last edited:

Suppost to change cid instead creature.uid?

Full script:
Code:
function doStartfirestorm()
   if Game.getStorageValue(fsJoinedCountGlobalStorage) > fsMaxPlayers then
     return false
   end
   
   if Game.getStorageValue(fsStartedGlobalStorage) == 2 then
     local specs = Game.getSpectators(fsArena, false, true, 0, 10, 0, 10)
     for i = 1, #specs do
       local randX, randY, randZ
         randX = math.random(fsArenaFromPosition.x, fsArenaToPosition.x)
         randY = math.random(fsArenaFromPosition.y, fsArenaToPosition.y)
         randZ = math.random(fsArenaFromPosition.z, fsArenaToPosition.z)
       local randfire = Position(randX, randY, randZ)
       local randX1, randY1, randZ1
         randX1 = math.random(fsArenaFromPosition.x, fsArenaToPosition.x)
         randY1 = math.random(fsArenaFromPosition.y, fsArenaToPosition.y)
         randZ1 = math.random(fsArenaFromPosition.z, fsArenaToPosition.z)
       local randfire1 = Position(randX1, randY1, randZ1)
       local creature, players = nil, Game.getPlayers()
       for i = 1, #players do
         creature = players[i]
         doSendDistanceShoot(fsArenaFromPosition, randfire, 4)
         doSendDistanceShoot(fsArenaToPosition, randfire, 4)
         doAreaCombatHealth(creature.uid, COMBAT_HOLYDAMAGE, randfire,randfire, -9999, -1000000,7)
       end
     end

   addEvent(doStartfirestorm, 500)
   end
end
 
Code:
function returnRandomPos(from, to)
    return math.random(from.x, to.x), math.random(from.y, to.y), math.random(from.z, to.z)
end
function doStartfirestorm()
    if Game.getStorageValue(fsJoinedCountGlobalStorage) > fsMaxPlayers then
        return false
    end
   
    if Game.getStorageValue(fsStartedGlobalStorage) == 2 then
        local specs = Game.getSpectators(fsArena, false, true, 0, 10, 0, 10)
        for i = 1, #specs do
            local randfire = Position( returnRandomPos(fsArenaFromPosition, fsArenaToPosition) )
            -- randfire1 isn't used in this function
            -- local randfire1 = Position( returnRandomPos(fsArenaFromPosition, fsArenaToPosition) )
            local creature, players = nil, Game.getPlayers()
            for i = 1, #players do
                creature = players[i]
                doSendDistanceShoot(fsArenaFromPosition, randfire, 4)
                doSendDistanceShoot(fsArenaToPosition, randfire, 4)
                doAreaCombatHealth(creature:getId(), COMBAT_HOLYDAMAGE, randfire, randfire, -9999, -1000000,7)
            end
        end
        addEvent(doStartfirestorm, 500)
    end
end
 
Code:
function returnRandomPos(from, to)
    return math.random(from.x, to.x), math.random(from.y, to.y), math.random(from.z, to.z)
end
function doStartfirestorm()
    if Game.getStorageValue(fsJoinedCountGlobalStorage) > fsMaxPlayers then
        return false
    end
   
    if Game.getStorageValue(fsStartedGlobalStorage) == 2 then
        local specs = Game.getSpectators(fsArena, false, true, 0, 10, 0, 10)
        for i = 1, #specs do
            local randfire = Position( returnRandomPos(fsArenaFromPosition, fsArenaToPosition) )
            -- randfire1 isn't used in this function
            -- local randfire1 = Position( returnRandomPos(fsArenaFromPosition, fsArenaToPosition) )
            local creature, players = nil, Game.getPlayers()
            for i = 1, #players do
                creature = players[i]
                doSendDistanceShoot(fsArenaFromPosition, randfire, 4)
                doSendDistanceShoot(fsArenaToPosition, randfire, 4)
                if creature:isCreature() then
                    doAreaCombatHealth(creature:getId(), COMBAT_HOLYDAMAGE, randfire, randfire, -9999, -1000000,7)
                end
            end
        end
        addEvent(doStartfirestorm, 500)
    end
end
 
The argument being passed is incorrect, randfire is a table and your passing it to the area parameter, the 2nd randfire should be set to 0 or some other area id.
Code:
-- doAreaCombatHealth(cid, type, pos, area, min, max, effect[, origin = ORIGIN_SPELL])
doAreaCombatHealth(creature:getId(), COMBAT_HOLYDAMAGE, randfire, randfire, -9999, -1000000,7)
 
Back
Top