Zakhran
Pace
Hi all, im looking for a script that when u kill x monster then u can move a lever to teleport you to a x place.. thnks
registerCreatureEvent(cid, "Event")
<event type="kill" name="Event" event="script" value="script.lua"/>
local t = {
['demon'] = {1337}
}
function onKill(cid, target, damage, flags)
local k = t[string.lower(getCreatureName(target))]
if(k and (damage == true or bit.band(flags, 1) == 1) and isMonster(target)) then
if(getCreatureStorage(cid, k[1]) < 0) then
doCreatureSetStorage(cid, k[1], 1)
end
end
return true
end
<action actionid="13375" event="script" value="script.lua"/>
local t = {
[1337] = {x = 100, y = 100, z = 7}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
for st, position in pairs(t) do
if(getCreatureStorage(cid, st) > 0) then
doTeleportThing(cid, position, false)
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
doCreatureSay(cid, "Teleported!", TALKTYPE_MONSTER)
else
return doPlayerSendCancel(cid, "Sorry, not possible.")
end
end
return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end
thanks worked perfectly, i have a question, i've maded a quest using that script, but when i want to add a new quest, i need to add a new line in login.lua? thanks again