Hiho
I've got this error
when I kill Morguthis, Asmunrah and Rahemos the teleport does not appear
script:
what is the problem?
Thanks !! eace:
I've got this error
when I kill Morguthis, Asmunrah and Rahemos the teleport does not appear
script:
Code:
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "hotaPortals")
local creaturename = getCreatureName(cid)
--- positions where the teleports will be created:
local omruc_in_pos = {x=33201, y=32999, z=14, stackpos=2}
local thalas_in_pos = {x=33397, y=32841, z=14, stackpos=2}
local dipthrah_in_pos = {x=33096, y=32588, z=15, stackpos=2}
local mahrdis_in_pos = {x=33189, y=32953, z=15, stackpos=2}
local vashresamun_in_pos = {x=33123, y=32655, z=15, stackpos=2}
local morguthis_in_pos = {x=33166, y=32694, z=14, stackpos=2}
local rahemos_in_pos = {x=33076, y=32779, z=14, stackpos=2}
local ashmunrah_in_pos = {x=33179, y=32881, z=11, stackpos=2}
--- positions where the teleports will be teleported you:
local omruc_to_pos = {x=33179, y=33017, z=14, stackpos=1}
local thalas_to_pos = {x=33350, y=32829, z=14, stackpos=1}
local dipthrah_to_pos = {x=33127, y=32593, z=15, stackpos=1}
local mahrdis_to_pos = {x=33175, y=32936, z=15, stackpos=1}
local vashresamun_to_pos = {x=33146, y=32667, z=15, stackpos=1}
local morguthis_in_pos = {x=33166, y=32694, z=14, stackpos=1}
local rahemos_in_pos = {x=33052, y=32778, z=14, stackpos=1}
local ashmunrah_in_pos = {x=33198, y=32886, z=11, stackpos=1}
local time_to_pass = 60 -- in seconds
local tpID = 5023
local doEffect = CONST_ME_ENERGYHIT
local message = "You now have 1 minute to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear."
if creaturename == 'omruc' then
teleport1 = doCreateTeleport(tpID, omruc_to_pos, omruc_in_pos)
teleport = doSetItemActionId(teleport2, 4072)
doSendMagicEffect(omruc_in_pos, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInOmrucWard, (1000*time_to_pass))
elseif creaturename == 'thalas' then
teleport2 = doCreateTeleport(tpID, thalas_to_pos, thalas_in_pos)
teleport = doSetItemActionId(teleport2, 4078)
doSendMagicEffect(thalas_in_pos, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInThalasWard, (1000*time_to_pass))
elseif creaturename == 'mahrdis' then
teleport3 = doCreateTeleport(tpID, mahrdis_to_pos, mahrdis_in_pos)
teleport = doSetItemActionId(teleport3, 4074)
doSendMagicEffect(mahrdis_in_pos, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInMahrdisWard, (1000*time_to_pass))
elseif creaturename == 'dipthrah' then
teleport4 = doCreateTeleport(tpID, dipthrah_to_pos, dipthrah_in_pos)
teleport = doSetItemActionId(teleport4, 4080)
doSendMagicEffect(dipthrah_in_pos, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInDipthrahWard, (1000*time_to_pass))
elseif creaturename == 'vashresamun' then
teleport5 = doCreateTeleport(tpID, vashresamun_to_pos, vashresamun_in_pos)
doSendMagicEffect(vashresamun_in_pos, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInVashresamunWard, (1000*time_to_pass))
elseif creaturename == 'morguthis' then
teleport6 = doCreateTeleport(tpID, morguthis_to_pos, morguthis_in_pos)
doSendMagicEffect(morguthis_in_pos, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInMorguthisWard, (1000*time_to_pass))
elseif creaturename == 'rahemos' then
teleport7 = doCreateTeleport(tpID, rahemos_to_pos, rahemos_in_pos)
doSendMagicEffect(rahemos_in_pos, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInRahemosWard, (1000*time_to_pass))
elseif creaturename == 'ashmunrah' then
teleport8 = doCreateTeleport(tpID, ashmunrah_to_pos, ashmunrah_in_pos)
doSendMagicEffect(ashmunrah_in_pos, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(removeTeleportInAshmunrahWard, (1000*time_to_pass))
end
end
function removeTeleportInomrucWard()
if getThingfromPos({x=33201, y=32999, z=14, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=33201, y=32999, z=14, z=12, stackpos=1}).uid,1)
doSendMagicEffect({x=33201, y=32999, z=14, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
function removeTeleportInthalasWard()
if getThingfromPos({x=33397, y=32841, z=14, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=33397, y=32841, z=14, stackpos=1}).uid,1)
doSendMagicEffect({x=33397, y=32841, z=14, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
function removeTeleportIndipthrahWard()
if getThingfromPos({x=33096, y=32588, z=15, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=33096, y=32588, z=15, stackpos=1}).uid,1)
doSendMagicEffect({x=33096, y=32588, z=15, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
function removeTeleportInmahrdisWard()
if getThingfromPos({x=33189, y=32953, z=15, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=33189, y=32953, z=15, stackpos=1}).uid,1)
doSendMagicEffect({x=33189, y=32953, z=15, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
function removeTeleportInvashresamunWard()
if getThingfromPos({x=33123, y=32655, z=15, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=33123, y=32655, z=15, stackpos=1}).uid,1)
doSendMagicEffect({x=33123, y=32655, z=15, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
function removeTeleportInmorguthisWard()
if getThingfromPos({x=33166, y=32694, z=14, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=33166, y=32694, z=14, stackpos=1}).uid,1)
doSendMagicEffect({x=33166, y=32694, z=14, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
function removeTeleportInrahemosWard()
if getThingfromPos({x=33076, y=32779, z=14, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=33076, y=32779, z=14, stackpos=1}).uid,1)
doSendMagicEffect({x=33076, y=32779, z=14, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
function removeTeleportInashmunrahWard()
if getThingfromPos({x=33179, y=32881, z=11, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=33179, y=32881, z=11, stackpos=1}).uid,1)
doSendMagicEffect({x=33179, y=32881, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
Thanks !! eace:
Last edited by a moderator: