</flags>
<script>
<event name="Hiportal"/>
</script>
<event type="death" name="Hiportal" script="Portal.lua"/>
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "Hiportal")
local creaturename = getCreatureName(cid)
--- Position of the Created Portal
local FerIn = {x=1275, y=404, z=9, stackpos=1}
--- Destination of the Portal
local FerTo = {x=1310, y=430, z=9, stackpos=1}
local TicToc = 120 -- en segundos
local tpID = 1387
local doEffect = CONST_ME_TELEPORT
local Puf = CONST_ME_POFF
local message = "You Have 2 Minutes to Pass in the Teleport!!!"
if creaturename == 'Ferumbras' then
teleport = doCreateTeleport(tpID, FerTo, FerIn)
doSendMagicEffect(FerIn, doEffect)
doCreatureSay(cid, message, TALKTYPE_ORANGE_1)
addEvent(byeTP,(1000*TicToc),FerIn,tpID,Puf)
end
end
function byeTP(FerIn,tpID,Puf)
if getThingfromPos(FerIn).itemid == tpID then
doRemoveItem(getThingfromPos(FerIn).uid,1)
doSendMagicEffect(FerIn, Puf)
return TRUE
end
end
I going to Work in the creature "Ferumbras"
Place This Extra Code In Your Creature (the monster that must die to become portal):
After:
Place:Code:</flags>
Code:<script> <event name="Hiportal"/> </script>
Now in Creaturescripts.xml Add:
Code:<event type="death" name="Hiportal" script="Portal.lua"/>
In the scripts create the file named Portal.lua and save this code on it:
Code:function onDeath(cid, corpse, killer) registerCreatureEvent(cid, "Hiportal") local creaturename = getCreatureName(cid) --- Position of the Created Portal local FerIn = {x=1275, y=404, z=9, stackpos=1} --- Destination of the Portal local FerTo = {x=1310, y=430, z=9, stackpos=1} local TicToc = 120 -- en segundos local tpID = 1387 local doEffect = CONST_ME_TELEPORT local Puf = CONST_ME_POFF local message = "You Have 2 Minutes to Pass in the Teleport!!!" if creaturename == 'Ferumbras' then teleport = doCreateTeleport(tpID, FerTo, FerIn) doSendMagicEffect(FerIn, doEffect) doCreatureSay(cid, message, TALKTYPE_ORANGE_1) addEvent(byeTP,(1000*TicToc),FerIn,tpID,Puf) end end function byeTP(FerIn,tpID,Puf) if getThingfromPos(FerIn).itemid == tpID then doRemoveItem(getThingfromPos(FerIn).uid,1) doSendMagicEffect(FerIn, Puf) return TRUE end end
Finally you must change the creature and the coordinates