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

Tfs 1.0 Crash after DoRemoveCreature

  • Thread starter Deleted member 141899
  • Start date
D

Deleted member 141899

Guest
Hello, im using tfs 1.0..

Im testing the creaturescript of omrafir, and everytime him explode, the server crash.. BUT..

only crashes when a player is attacking the same (target), and omrafir explodes and performs the function "doRemoveCreature" I think, when no one is attacking omrafir and it explodes, no crashes...

Script:
Code:
local running = false
function onThink(cid)
local hp = (getCreatureHealth(cid)/getCreatureMaxHealth(cid))*100
local summons = getCreatureSummons(cid)
    if (hp < 50 and not running and #summons < 3) then
    running = true
    addEvent(Boom, 1000, cid) 
    end

function Boom (cid)
    doCreatureSay(cid, "OMRAFIR EXPLODES INTO FLAMES!", TALKTYPE_ORANGE_2)
    running = false
    doSummonCreature("Hellfire Fighter", { x=33585, y=32373, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33587, y=32374, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33590, y=32374, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33592, y=32378, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33589, y=32379, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33584, y=32381, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33590, y=32382, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33595, y=32381, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33588, y=32378, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33581, y=32379, z=12 })
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREATTACK)
    doRemoveCreature(cid)
    addEvent(Spawn, 10000, cid) 
    end
   
function Spawn(cid)
doSummonCreature("Omrafir2", { x=33586, y=32379, z=12 })
end

    return true
end

Can help me?
 
Not sure why this script would cause a crash. If you do not have debugging enabled try to comment out each part of the script until you narrow down exactly what part is causing the crash.

I did however fix some things for you because the script was somewhat of a mess.

Code:
local running = false

local function Boom(cid)
    running = false
   
    if(not isCreature(cid)) then return false end
   
    doCreatureSay(cid, "OMRAFIR EXPLODES INTO FLAMES!", TALKTYPE_ORANGE_2)
    doSummonCreature("Hellfire Fighter", { x=33585, y=32373, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33587, y=32374, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33590, y=32374, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33592, y=32378, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33589, y=32379, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33584, y=32381, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33590, y=32382, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33595, y=32381, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33588, y=32378, z=12 })
    doSummonCreature("Hellfire Fighter", { x=33581, y=32379, z=12 })
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREATTACK)
    doRemoveCreature(cid)
    addEvent(doSummonCreature, 1000, "Omrafir2", { x=33586, y=32379, z=12 })
end
   
function onThink(cid)
    local hp = (getCreatureHealth(cid)/getCreatureMaxHealth(cid))*100
    local summons = getCreatureSummons(cid)
    if (hp < 50 and not running and #summons < 3) then
        running = true
        addEvent(Boom, 1000, cid) 
    end
    return true
end
 
Now works 100%, thank you man! I think before the function are running everytime same with no monster, causing crash..

(sorry my bad english =x)
 
Im testing here and now when omrafir dead, the server crashs... if you want i put crash log.. but i dont understand it..

before the crash occurred when omrafir disappeared and sumon the hellfire fighter, now crashes when he dies

***EDIT

I change local function boom to function boom and it seems that solved, im test and no crashs..
 
Last edited by a moderator:
Back
Top