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

Theres no effects :(

Joined
Mar 14, 2020
Messages
139
Solutions
3
Reaction score
11
My combat effect isn't working :(

code:

Lua:
local spec = Game.getSpectators(creature:getPosition(), false, false, 4, 4, 4, 4)
        for _, c in pairs(spec) do
            if c and (c:isPlayer() or c:getMaster()) then
                doTargetCombatHealth(creature:getId(), c, COMBAT_EARTHDAMAGE, -250000, -250000, 35)
            end
        end
35 = CONST_ME_GROUNDSHAKER

already tried CONST_ME_GROUNDSHAKER, not work either :/ the COMBAT_EARTHDAMAGE is working well, and the script over all is working, but no effect :(
 
Solution
E
okay, look the first spell on this post and see how he used AREA1 with doAreaCombatHealth

use
Lua:
Position(pos):sendMagicEffect(magicEffect, ...)
bellow doTargetCombat
i did:

Position(creature:getPosition()):sendMagicEffect(CONST_ME_GROUNDSHAKER)
Nothing happens, no error in distro.


i did:
Position(creature:getPosition()):sendMagicEffect(magicEffect, CONST_ME_GROUNDSHAKER)
tibia crash, no distro error.

i also did:
local posEffect = creature:getPosition()

Position(posEffect):sendMagicEffect(CONST_ME_GROUNDSHAKER)
posEffect["x"] = posEffect["x"]+1
posEffect["y"] = posEffect["y"]+1

nothing happens aswell :(
 
okay, look the first spell on this post and see how he used AREA1 with doAreaCombatHealth

 
Solution
okay, look the first spell on this post and see how he used AREA1 with doAreaCombatHealth

with that link i could realize what i'm doing wrong, so, i did this function to use:

Now i can personalize even more ^^
Lua:
local function effect(posEffect)
    local posTemp = {x=0,y=0,z=6}
    local posTempNeg = {x=0,y=0,z=6}
    for x = posEffect["x"]-3, posEffect["x"]+4 do
    posTemp["x"] = x
    posTempNeg["x"] = x-1
        for y = posEffect["y"]-3, posEffect["y"]+4 do
            posTemp["y"] = y
            posTempNeg["y"] = y-1
            Position(posTemp):sendMagicEffect(CONST_ME_GROUNDSHAKER)
            Position(posTempNeg):sendMagicEffect(CONST_ME_GROUNDSHAKER)
            Position(posTemp):sendMagicEffect(CONST_ME_STONES)
            Position(posTempNeg):sendMagicEffect(CONST_ME_STONES)
        end
    end
end
 
Back
Top