• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Magic Wall!(Including Countdown) 95% Easy Configurtion!

make a new support thread, don't bump old threads that have nothing to do with what you're asking for
 
2 erros, it can be casted in my postion of caster (from pos == to pos)
and also when I spam used many mw in same pos it duplicate the counter with no magicwallll (when there is magic wall already)
 
Here is the code for TFS 1.2 not tested

Code:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
combat:setParameter(COMBAT_PARAM_CREATEITEM, ITEM_MAGICWALL)

function onCastSpell(creature, variant, isHotkey)
    if combat:execute(creature, variant) then
        local pos = variantToPos(variant)
    
        if pos then
            local WALL = Tile(pos):getItemById(ITEM_MAGICWALL)
            if WALL then
                local timeWall = 30 --How many seconds walls last in items.xml
                local playerName = creature:getName()
                addEvent(startTimer, 0, playerName, pos, timeWall)
            end
        end
    end
end

function startTimer(playerName, pos, tmpTime)
    local player = Player(playerName)
    if not player then return false end
    if tmpTime == 0 then return false end
    
    player:say(tmpTime, TALKTYPE_MONSTER_SAY, 0, 1, pos)
    tmpTime = tmpTime - 1
    addEvent(startTimer, 1000, playerName, pos, tmpTime)
return true
end
 
Let me see the code? If you are using the one from this thread its way too much....
 
he just put a countdown function above the create wall lines
so anyway you try to magic wall it will make count down, solve: just take the count down lines under ' create magic wall part' so it will make a count down when the magic wall is created!
 
Yeah, it shouldn't even be an action script sooooo
 
Back
Top