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

take a look please, script isnot working

CheatsBCN

New Member
Joined
Mar 6, 2012
Messages
131
Reaction score
1
Hello im trying to make a script that when demodras is killed, a stairs apears. this is what i've done. (i use tfs 0.2)

on creaturescripts:
XML:
    <event type="death" name="demodras" event="script" value="monsterPuente.lua"/>

then i opened the demodras.lua and added this on the last sentence..
XML:
    <script>
            <event name="demodras"/>
    </script>
</monster>



and finally i did a script for it:


Lua:
function onDeath(cid, corpse, deathList, pos)
    local pos1 = {x=1146,y=1101,z=6} -- POSICIÓN DE UNA PARTE DEL PUENTE
    --local pos2 = {x=1114,y=1029,z=7} -- POSICIÓN DE LA OTRA PARTE DEL PUENTE
    local drawbridge = 8282 -- EL PUENTE (DÉJALO COMO ESTÁ)
    local void = 100 -- EL SUELO NEGRO Y NARANJA (DÉJALO COMO ESTÁ)
    local seg = 30 -- SEGUNDOS QUE TARDARÁ EN DESAPARECER EL PUENTE
    local monstName = "Medusa" -- NOMBRE DEL MONSTRUO QUE HAY QUE MATAR PARA QUE SALGA EL PUENTE     
        if isMonster(cid) then
            if string.lower(getCreatureName(cid)) == string.lower(monstName) then
              doCreatureSay(cid, "Tienes 5 segundos para cruzar el puente, MuAHUhauHAUhauhUAH.", TALKTYPE_ORANGE_1) -- MENSAJE QUE DIRÁ EL MONSTRUO AL MORIR
           doRemoveItem (getThingFromPos(pos1).uid)
           --doRemoveItem (getThingFromPos(pos2).uid)
           doCreateItem (drawbridge, 1, pos1)
           --doCreateItem (drawbridge, 1, pos2)
            doSendMagicEffect (pos1, (3)) -- NÚMERO DEL EFECTO MÁGICO QUE SALDRÁ CUANDO APAREZCA EL PUENTE
            doSendMagicEffect (pos2, (3)) -- NÚMERO DEL EFECTO MÁGICO QUE SALDRÁ CUANDO APAREZCA EL PUENTE
          
           addEvent (doCreateItem, 1000 * seg, void, 1, pos1)
           --addEvent (doCreateItem, 1000 * seg, void, 1, pos2)
           addEvent (doSendMagicEffect, 1000 * seg, pos1, (2)) -- NÚMERO DEL EFECTO MÁGICO QUE SALDRÁ CUANDO DESAPAREZCA EL PUENTE
           --addEvent (doSendMagicEffect, 1000 * seg, pos2, (2)) -- NÚMERO DEL EFECTO MÁGICO QUE SALDRÁ CUANDO DESAPAREZCA EL PUENTE
          
        end
    end
return TRUE
end


and i dont know why, i keep geting this error on console:

Warning: [Monster::Monster]. Unknown event name - demodras




znote tryed to help me in skype, but he didnt know what to do neither. helps i apreciated

rep++
 
Last edited by a moderator:
yea ofc i reaload even restartit i did everything but seems not working

- - - Updated - - -

argg i sreiously need this sto make the quests then ill be done!!!

- - - Updated - - -

willing to pay for some help =)
 
I don't think you can remove a ground tile, I think you can only just create a new one on-top of it.
That's probably why it's not working.
 
yes you can, you just need to use stackpos = 0 on the coordenates so it knows to "use"(delete in this case) the floor, otherwise ur indexing just the position, and a position can have multiple items
 
yes you can, you just need to use stackpos = 0 on the coordenates so it knows to "use"(delete in this case) the floor, otherwise ur indexing just the position, and a position can have multiple items

Oh okay, I just thought I saw a similar issue when removing tiles causing debugs.
Well, yeah stackpos = 0 is for ground tiles. Instead of removing/creating, why not transform?
 
removing tiles is dangerous though! you should never do it without a good reason!

when you remove a tile from the map in visible range from at least one player, the client's buffer will still think that that tile exists, so walking over it will crash the client and everyone else looking at it! To fix it or avoid it from happening, all players must be at least 10 or so tiles away from the tile you changed, or the tile won't be removed for them and when someone walks over that tile, they will crash!

I know this because I did alot of testing when developing my Random Dungeon Generator for my upcoming OT :)
 
Last edited:
Try this i hope it works to you:

function onDeath(cid, corpse, deathList, pos)
local pos1 = {x=1146,y=1101,z=6}
local drawbridge = 8282
local void = 100
local seg = 30
local monstName = "Demodras"

if isMonster(cid) then
if(getCreatureName(cid):lower) == monstName:lower then
doCreatureSay(cid, "Tienes 5 segundos para cruzar el puente, MuAHUhauHAUhauhUAH.", TALKTYPE_ORANGE_1) -- MENSAJE QUE DIRÁ EL MONSTRUO AL MORIR
doRemoveItem (getThingFromPos(pos1).uid)
doCreateItem (drawbridge, 1, pos1)
doSendMagicEffect (pos1, (3)) -- NÚMERO DEL EFECTO MÁGICO QUE SALDRÁ CUANDO APAREZCA EL PUENTE
doSendMagicEffect (pos2, (3)) -- NÚMERO DEL EFECTO MÁGICO QUE SALDRÁ CUANDO APAREZCA EL PUENTE
addEvent (doCreateItem, 1000 * seg, void, 1, pos1)
addEvent (doSendMagicEffect, 1000 * seg, pos1, (2)) -- NÚMERO DEL EFECTO MÁGICO QUE SALDRÁ CUANDO DESAPAREZCA EL PUENTE
end
end

end
return TRUE
end
 
Back
Top