• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua After kill a Monster Teleporter Appear dont work TFS 0.3.7

Blysco

New Member
Joined
Oct 12, 2013
Messages
163
Reaction score
2
Hey, want that when i kill a Monster "Orshabaal" that a Teleporter appear here x=32277, y= 32026, z=13.
I found some scripts but none of them wont really work for me.

The console say that a unenspectet Symbol is somewhere.

But some hours earlier it works without a Error. But no Teleporter appeared after i killed the Orshabaal.
And after that happend i just tried a little bit and changed some thing and now it wont work anymore.

Thx for all solutions.

Creaturscripts/scripts
Code:
 local config = {timeToRemove = 120, -- seconds
message = "TELEPORT HAS BEEN OPENED FOr 120 SECONDS",teleportId = ,bosses = { -- Monster Name, Teleport Position["MONSTER NAME"] = { pos={ x=32277, y= 32026, z=13 , stackpos=1 }, aid=1001 },
},local function removal(position)
doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
return TRUE
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)
return TRUE
end
return TRUE
end


movements/createteleport.lua
Code:
local config = {
bosses={---aid of portal, position where it sends, value it sets, text it shows
[1001] = {pos={x=32277, y=32026, z=13, stackpos=1}, value=1, text="Entered the Cave"},

function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE 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, t.pos)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid,t.text,TALKTYPE_ORANGE_1)
elseif(config.mainroom[item.actionid]) then
local t= config.mainroom[item.actionid]
if getPlayerStorageValue(cid, config.storage)>=t.value then
doTeleportThing(cid, t.pos)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid,t.text,TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, fromPosition)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid, 'You don\'t have enough energy to enter this portal', TALKTYPE_ORANGE_1)
end
elseif(config.portals[item.actionid]) then
local t= config.portals[item.actionid]
doTeleportThing(cid, t.pos)
doSendMagicEffect(getCreaturePosition(cid),10)
doCreatureSay(cid,t.text,TALKTYPE_ORANGE_1)
end
end
 
Missing brackets and config variables but it should work now I guess. :p
Code:
local config = {
   timeToRemove = 120, -- seconds
   message = "TELEPORT HAS BEEN OPENED FOr 120 SECONDS",
   teleportId = 1387,

   bosses = {
   ["Monster name"] = {pos = {x = 32277, y = 32026, z = 13, stackpos=1}, aid=1001}
   }
}

local function removal(position)
   doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
   return true
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 = {
     [1001] = {pos = {x = 32273, y = 32051, z = 13, stackpos=1}, value = 1, text = "Entered the Cave"}
   },
   storage = 56123
}

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, t.pos)
   doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
   doCreatureSay(cid, t.text, TALKTYPE_ORANGE_1)
   end
end
 
Last edited:
Works, i forgott to say that i want that the Teleporter should teleport me to [X: 32273] [Y: 32051] [Z: 13]

Cann you add it to the Script ??

Thank you !
 
Cann someone say me how i cann add a Destination point ? [X: 32273] [Y: 32051] [Z: 13]

When i go in to the Teleporter it says You entered the blablabla......
But i dont get teleportet pls help
and another problem is that when i change the Text
Code:
text = "You cleaned all rooms, here are your rewards !"}

The Teleporter says the old Text.
 
Back
Top