massuco
Brazilian, sorry for my bad english XD
Hello, as the tittle says, I have one monster and want to when he dies, he transform on one teleport, not on a corpse.
I am using OTHire and get this script.
I have registered on login.lua of creaturescripts and on the monster script, but on the monster die, I get the error:
I dont know how to make this line works:
I know that the function doCreateTeleport on OThire have the params:
teleportID = 1387
positionToGo is the position configured on the script
createPosition is the position that monster died.
Any ideias?
I am using OTHire and get this script.
Lua:
local bosses = {
["rat"] = { x = 1146, y = 981, z = 7 }
}
local time = 30 -- Seconds
function onKill(cid, target, lastHit, fromPosition)
for name, pos in pairs(bosses) do
if (name == getCreatureName(target):lower()) then
doCreateTeleport(1387, pos[1], getThingPos(uid))
addEvent(doRemoveItem, tpTime * 1000, getTileItemById(pos[2], 1387).uid, 1)
end
end
return true
end
I have registered on login.lua of creaturescripts and on the monster script, but on the monster die, I get the error:
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/monsterPortals.lua:onKill
LuaScriptInterface::luaGetThingPos(). Thing not found
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/monsterPortals.lua:onKill
attempt to index a nil value
stack traceback:
[C]: in function 'doCreateTeleport'
data/creaturescripts/scripts/monsterPortals.lua:10: in function <data/creaturescripts/scripts/monsterPortals.lua:6>
Lua:
doCreateTeleport(1387, pos[1], getThingPos(uid))
I know that the function doCreateTeleport on OThire have the params:
Lua:
doCreateTeleport(teleportID, positionToGo, createPosition)
positionToGo is the position configured on the script
createPosition is the position that monster died.
Any ideias?