local x = {
monster = { -- Monster Name, Teleport To Position
["Monstername"] = {tp={x=1214, y=1233, z=11}}
}
}
function onKill(cid, target, lastHit)
local tar = x.monster[getCreatureName(target)]
if(not isPlayer(target)) and isPlayer(cid) and tar and not(getCreatureMaster(target)) then
doTeleportThing(cid, tar.tp)
doSendMagicEffect(tar.tp, CONST_ME_TELEPORT)
end
return true
end
registerCreatureEvent(cid, "myevent")
<event type="kill" name="myevent" event="script" value="myfile.lua" />
local t = {
-- Monster Name, Teleport To Position
["Monstername"] = {x=1214, y=1233, z=11}
}
function onKill(cid, target, lastHit)
if isMonster(target) and getCreatureMaster(target) == target then
local k = t[getCreatureName(target)]
if k then
doTeleportThing(cid, k)
doSendMagicEffect(k, CONST_ME_TELEPORT)
end
end
return true
end
and this now when i kill monster i teletransportate xD hehe :3local config = {
monster = { -- Monster Name, Teleport Position
["Cult Assassin"] = {pos={ x=1400, y=1200, z=7, stackpos=2 }},
}
}
function onKill(cid, target, lastHit)
if(config.monster[getCreatureName(target)]) then
local t = config.monster[getCreatureName(target)]
local position = t.pos
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doTeleportThing(cid, t.pos)
doSendMagicEffect(t.pos, CONST_ME_TELEPORT)
end
return TRUE
end