Blysco
New Member
- Joined
- Oct 12, 2013
- Messages
- 163
- Reaction score
- 2
I dont know why it dont works...
I get no Errors but it dont works.
Nothing happend after i killed the Monster
I get no Errors but it dont works.
Nothing happend after i killed the Monster
Code:
local config = {
timeToRemove = 50, -- seconds
message = "Teleporter appeared for 50 seconds, You should enter the Teleporter !",
teleportId = 1387,
monster = {
["Carrion Worm"] = {pos ={x = 32359, y = 32205, z = 8, stackpos=1}, aid=1062}
}
}
local function removal(position)
doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
return true
end
function onStepIn(cid, item, pos)
local tam = {x = 32441, y = 32180, z = 9}
if item.actionid == 1062 then
doTeleportThing(cid,tam)
doSendMagicEffect(getCreaturePosition(cid),1)
local tp = doRemoveItem(item.uid, 1387)
end
return 1
end
function onKill(cid, target, lastHit)
if(config.bosses[getCreatureName(target)]) then
local t = config.bosses[getCreatureName(target)]
local teleport = doCreateItem(config.teleportId, t.pos)
local position = t.pos
doItemSetAttribute(teleport, "aid", t.aid)
doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
addEvent(removal, config.timeToRemove * 1000, position)
end
return true
end
Code:
local config =
{
bosses = {
[1062] = {pos = {x = 32441, y = 32180, z = 9, stackpos=1}, value = 1, text = "You got teleportet in a mystery cave !"}
},
storage = 56129
}
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) then
if(config.bosses[item.actionid]) then
local t = config.bosses[item.actionid]
if getPlayerStorageValue(cid, config.storage) < t.value then
setPlayerStorageValue(cid, config.storage, t.value)
end
doTeleportThing(cid,{x = 32441, y = 32180, z = 9})
doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
doCreatureSay(cid, t.text, TALKTYPE_ORANGE_1)
end
end
end