• 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!

CreatureEvent [Inquisition] Create Teleport When Boss Die!

Renamed the creature to just Xief and didnt get that error, however now i get this one ::

Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/login.lua

luaRegisterCreatureEvent(). Creature not found

The code i changed / using now is :
Code:
function onDeath(cid, corpse, killer)

	registerCreatureEvent(cid, "voodoo")

	local creaturename = getCreatureName(cid)

--- positions where the teleports will be created:
 
	local xief_in_pos = {x=1226, y=935, z=8, stackpos=2} 

--- positions where the teleports will be teleported you:

 	local xief_to_pos = {x=1233, y=941, z=8, stackpos=1} 

	local time_to_pass = 180 -- in seconds
	local tpID = 1387
	local doEffect = CONST_ME_TELEPORT
	local message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear"

	if creaturename == 'xief' then

			teleport = doCreateTeleport(tpID, xief_to_pos, xief_in_pos)

			doSendMagicEffect(ushuriel_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInUshurielWard, (1000*time_to_pass))

	
		end 
end

function removeTeleportInUshurielWard()
	if getThingfromPos({x=1226, y=935, z=8, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=1226, y=935, z=8, stackpos=2}).uid,1)
	doSendMagicEffect({x=1226, y=935, z=8, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInAnnihilonWard()
	if getThingfromPos({x=143, y=963, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=143, y=963, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=143, y=963, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInHellgorakWard()
	if getThingfromPos({x=244, y=959, z=4, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=244, y=959, z=4, stackpos=2}).uid,1)
	doSendMagicEffect({x=244, y=959, z=4, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInMadarethWard()
	if getThingfromPos({x=345, y=1017, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=345, y=1017, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=345, y=1017, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInZuguroshWard()
	if getThingfromPos({x=509, y=1190, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=509, y=1190, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=509, y=1190, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInBrothersWard()
	if getThingfromPos({x=219, y=1041, z=7, stackpos=1}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=219, y=1041, z=7, stackpos=1}).uid,1)
	doSendMagicEffect({x=219, y=1041, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

Also this is whats in creaturescripts/scripts/login.lua :
function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
return TRUE
end

registerCreatureEvent(cid, "inquisitionPortals")
 
put the code:
Code:
registerCreatureEvent(cid, "inquisitionPortals")
before:
Code:
return TRUE
end

Mefiu said:
So some1 got it working on the newest tfs ?? I rly need this.
Change the function "getThingfromPos(pos)" to "getThingFromPos(pos)"
 
Tried it, got the same error message ::

Code:
function onDeath(cid, corpse, killer)

	registerCreatureEvent(cid, "voodoo")

	local creaturename = getCreatureName(cid)

--- positions where the teleports will be created:
 
	local xief_in_pos = {x=1226, y=935, z=8, stackpos=2} 

--- positions where the teleports will be teleported you:

 	local xief_to_pos = {x=1233, y=941, z=8, stackpos=1} 

	local time_to_pass = 180 -- in seconds
	local tpID = 1387
	local doEffect = CONST_ME_TELEPORT
	local message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear"

	if creaturename == 'xief' then

			teleport = doCreateTeleport(tpID, xief_to_pos, xief_in_pos)

			doSendMagicEffect(ushuriel_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInUshurielWard, (1000*time_to_pass))

	
		end 
end

function removeTeleportInUshurielWard()
	if getThingfromPos({x=1226, y=935, z=8, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=1226, y=935, z=8, stackpos=2}).uid,1)
	doSendMagicEffect({x=1226, y=935, z=8, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInAnnihilonWard()
	if getThingfromPos({x=143, y=963, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=143, y=963, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=143, y=963, z=7, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInHellgorakWard()
	if getThingfromPos({x=244, y=959, z=4, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=244, y=959, z=4, stackpos=2}).uid,1)
	doSendMagicEffect({x=244, y=959, z=4, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInMadarethWard()
	if getThingfromPos({x=345, y=1017, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=345, y=1017, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=345, y=1017, z=7, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInZuguroshWard()
	if getThingfromPos({x=509, y=1190, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=509, y=1190, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=509, y=1190, z=7, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInBrothersWard()
	if getThingfromPos({x=219, y=1041, z=7, stackpos=1}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=219, y=1041, z=7, stackpos=1}).uid,1)
	doSendMagicEffect({x=219, y=1041, z=7, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

First i added "registerCreatureEvent(cid, "inquisitionPortals")" only on the first return TRUE, tested, didnt work. Than added it to them all, tested, samething.
 
put the code:
Code:
registerCreatureEvent(cid, "inquisitionPortals")
before:
Code:
return TRUE
end
Change the function "getThingfromPos(pos)" to "getThingFromPos(pos)"
It is actually supposed to be a non-capitalized f, so "getThingfromPos" is correct, whilst "getThingFromPos" isn't. ;- )
 
Oh, my bad. That is pretty new then isn't it? c_c
 
@up
i think u were right because i haven't changed "getThingfromPos(pos)" to "getThingFromPos(pos)" and it worked :p

Btw.
Im using Rudolf Czarodziej's script.
 
Tried it, got the same error message ::

Code:
function onDeath(cid, corpse, killer)

	registerCreatureEvent(cid, "voodoo")

	local creaturename = getCreatureName(cid)

--- positions where the teleports will be created:
 
	local xief_in_pos = {x=1226, y=935, z=8, stackpos=2} 

--- positions where the teleports will be teleported you:

 	local xief_to_pos = {x=1233, y=941, z=8, stackpos=1} 

	local time_to_pass = 180 -- in seconds
	local tpID = 1387
	local doEffect = CONST_ME_TELEPORT
	local message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear"

	if creaturename == 'xief' then

			teleport = doCreateTeleport(tpID, xief_to_pos, xief_in_pos)

			doSendMagicEffect(ushuriel_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInUshurielWard, (1000*time_to_pass))

	
		end 
end

function removeTeleportInUshurielWard()
	if getThingfromPos({x=1226, y=935, z=8, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=1226, y=935, z=8, stackpos=2}).uid,1)
	doSendMagicEffect({x=1226, y=935, z=8, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInAnnihilonWard()
	if getThingfromPos({x=143, y=963, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=143, y=963, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=143, y=963, z=7, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInHellgorakWard()
	if getThingfromPos({x=244, y=959, z=4, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=244, y=959, z=4, stackpos=2}).uid,1)
	doSendMagicEffect({x=244, y=959, z=4, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInMadarethWard()
	if getThingfromPos({x=345, y=1017, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=345, y=1017, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=345, y=1017, z=7, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInZuguroshWard()
	if getThingfromPos({x=509, y=1190, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=509, y=1190, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=509, y=1190, z=7, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

function removeTeleportInBrothersWard()
	if getThingfromPos({x=219, y=1041, z=7, stackpos=1}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=219, y=1041, z=7, stackpos=1}).uid,1)
	doSendMagicEffect({x=219, y=1041, z=7, stackpos=1}, CONST_ME_POFF)
registerCreatureEvent(cid, "inquisitionPortals")
	return TRUE
	end
end

First i added "registerCreatureEvent(cid, "inquisitionPortals")" only on the first return TRUE, tested, didnt work. Than added it to them all, tested, samething.

Bump, help please.
 
Bump ::

Sorry for double posting but if i got this to work it'd be great. I changed the script to this ::
Code:
function onDeath(cid, corpse, killer)

	registerCreatureEvent(cid, "inquisitionPortals")

	local creaturename = getCreatureName(cid)

--- positions where the teleports will be created:

	local demodras_in_pos = {x=812, y=1037, z=9, stackpos=2} 
	local xief_in_pos = {x=1225, y=936, z=8, stackpos=2} 
	local hellgorak_in_pos = {x=244, y=959, z=4, stackpos=2} 
	local madareth_in_pos = {x=345, y=1017, z=7, stackpos=2} 
	local zugurosh_in_pos = {x=509, y=1190, z=7, stackpos=2} 
	local brothers_in_pos = {x=219, y=1041, z=7, stackpos=1}

--- positions where the teleports will be teleported you:

	local demodras_to_pos = {x=995, y=996, z=7, stackpos=1}
	local xief_to_pos = {x=1231, y=941, z=8, stackpos=1}  
	local hellgorak_to_pos = {x=169, y=1047, z=6, stackpos=1} 
	local madareth_to_pos = {x=416, y=1017, z=7, stackpos=1} 
	local zugurosh_to_pos = {x=424, y=1119, z=7, stackpos=1} 
	local brothers_to_pos = {x=46, y=1109, z=7, stackpos=1}

	local time_to_pass = 180 -- in seconds
	local tpID = 1387
	local doEffect = CONST_ME_TELEPORT
	local message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear"

	if creaturename == 'Demodras' then

			teleport = doCreateTeleport(tpID, demodras_to_pos, demodras_in_pos)

			doSendMagicEffect(demodras_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInUshurielWard, (1000*time_to_pass))

	elseif creaturename == 'Xief' then

			teleport = doCreateTeleport(tpID, xief_to_pos, annihilon_in_pos)

			doSendMagicEffect(xief_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInAnnihilonWard, (1000*time_to_pass))

	elseif creaturename == 'Madareth' then

			teleport = doCreateTeleport(tpID, madareth_to_pos, madareth_in_pos)

			doSendMagicEffect(madareth_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInMadarethWard, (1000*time_to_pass)) 

	elseif creaturename == 'Hellgorak' then

			teleport = doCreateTeleport(tpID, hellgorak_to_pos, hellgorak_in_pos)

			doSendMagicEffect(hellgorak_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInHellgorakWard, (1000*time_to_pass)) 

	elseif creaturename == 'Zugurosh' then

			teleport = doCreateTeleport(tpID, zugurosh_to_pos, zugurosh_in_pos)

			doSendMagicEffect(zugurosh_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInZuguroshWard, (1000*time_to_pass))

	elseif creaturename == 'Latrivan' then

			teleport = doCreateTeleport(tpID, brothers_to_pos, brothers_in_pos)

			doSendMagicEffect(brothers_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInBrothersWard, (1000*time_to_pass))

	
		end 
end

function removeTeleportInUshurielWard()
	if getThingfromPos({x=812, y=1037, z=9, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=812, y=1037, z=9, stackpos=2}).uid,1)
	doSendMagicEffect({x=812, y=1037, z=9, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInAnnihilonWard()
	if getThingfromPos({x=1225, y=936, z=8, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=1225, y=936, z=8, stackpos=2}).uid,1)
	doSendMagicEffect({x=1225, y=936, z=8, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInHellgorakWard()
	if getThingfromPos({x=244, y=959, z=4, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=244, y=959, z=4, stackpos=2}).uid,1)
	doSendMagicEffect({x=244, y=959, z=4, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInMadarethWard()
	if getThingfromPos({x=345, y=1017, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=345, y=1017, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=345, y=1017, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInZuguroshWard()
	if getThingfromPos({x=509, y=1190, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=509, y=1190, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=509, y=1190, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInBrothersWard()
	if getThingfromPos({x=219, y=1041, z=7, stackpos=1}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=219, y=1041, z=7, stackpos=1}).uid,1)
	doSendMagicEffect({x=219, y=1041, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

Also, when i run the server, the console shows this ::
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/login.lua

luaRegisterCreatureEvent(). Creature not found
The portal for demodras works, but the custom creature i made Xief doesnt.
 
Isn't there many other Inquisition scripts? :eek: I'm pretty sure I saw the whole quest in OTFans....
 
A tip is to use flobalStorageValute when you kill the boss, and when you have that certain globalStorage then you get teleported to next place and get a storagevalute when you enter the tp to access the tp in the "main room". else if you enter the tp you get to the "main room"
 
Man, it really sucks cause there is no reply, meaning no help.

Anyways, here's my issue ..again.

Sorry for double posting but if i got this to work it'd be great. I changed the script to this ::
Code:
function onDeath(cid, corpse, killer)

	registerCreatureEvent(cid, "inquisitionPortals")

	local creaturename = getCreatureName(cid)

--- positions where the teleports will be created:

	local demodras_in_pos = {x=812, y=1037, z=9, stackpos=2} 
	local xief_in_pos = {x=1225, y=936, z=8, stackpos=2} 
	local hellgorak_in_pos = {x=244, y=959, z=4, stackpos=2} 
	local madareth_in_pos = {x=345, y=1017, z=7, stackpos=2} 
	local zugurosh_in_pos = {x=509, y=1190, z=7, stackpos=2} 
	local brothers_in_pos = {x=219, y=1041, z=7, stackpos=1}

--- positions where the teleports will be teleported you:

	local demodras_to_pos = {x=995, y=996, z=7, stackpos=1}
	local xief_to_pos = {x=1231, y=941, z=8, stackpos=1}  
	local hellgorak_to_pos = {x=169, y=1047, z=6, stackpos=1} 
	local madareth_to_pos = {x=416, y=1017, z=7, stackpos=1} 
	local zugurosh_to_pos = {x=424, y=1119, z=7, stackpos=1} 
	local brothers_to_pos = {x=46, y=1109, z=7, stackpos=1}

	local time_to_pass = 180 -- in seconds
	local tpID = 1387
	local doEffect = CONST_ME_TELEPORT
	local message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear"

	if creaturename == 'Demodras' then

			teleport = doCreateTeleport(tpID, demodras_to_pos, demodras_in_pos)

			doSendMagicEffect(demodras_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInUshurielWard, (1000*time_to_pass))

	elseif creaturename == 'Xief' then

			teleport = doCreateTeleport(tpID, xief_to_pos, annihilon_in_pos)

			doSendMagicEffect(xief_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInAnnihilonWard, (1000*time_to_pass))

	elseif creaturename == 'Madareth' then

			teleport = doCreateTeleport(tpID, madareth_to_pos, madareth_in_pos)

			doSendMagicEffect(madareth_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInMadarethWard, (1000*time_to_pass)) 

	elseif creaturename == 'Hellgorak' then

			teleport = doCreateTeleport(tpID, hellgorak_to_pos, hellgorak_in_pos)

			doSendMagicEffect(hellgorak_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInHellgorakWard, (1000*time_to_pass)) 

	elseif creaturename == 'Zugurosh' then

			teleport = doCreateTeleport(tpID, zugurosh_to_pos, zugurosh_in_pos)

			doSendMagicEffect(zugurosh_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInZuguroshWard, (1000*time_to_pass))

	elseif creaturename == 'Latrivan' then

			teleport = doCreateTeleport(tpID, brothers_to_pos, brothers_in_pos)

			doSendMagicEffect(brothers_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInBrothersWard, (1000*time_to_pass))

	
		end 
end

function removeTeleportInUshurielWard()
	if getThingfromPos({x=812, y=1037, z=9, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=812, y=1037, z=9, stackpos=2}).uid,1)
	doSendMagicEffect({x=812, y=1037, z=9, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInAnnihilonWard()
	if getThingfromPos({x=1225, y=936, z=8, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=1225, y=936, z=8, stackpos=2}).uid,1)
	doSendMagicEffect({x=1225, y=936, z=8, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInHellgorakWard()
	if getThingfromPos({x=244, y=959, z=4, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=244, y=959, z=4, stackpos=2}).uid,1)
	doSendMagicEffect({x=244, y=959, z=4, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInMadarethWard()
	if getThingfromPos({x=345, y=1017, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=345, y=1017, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=345, y=1017, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInZuguroshWard()
	if getThingfromPos({x=509, y=1190, z=7, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=509, y=1190, z=7, stackpos=2}).uid,1)
	doSendMagicEffect({x=509, y=1190, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

function removeTeleportInBrothersWard()
	if getThingfromPos({x=219, y=1041, z=7, stackpos=1}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=219, y=1041, z=7, stackpos=1}).uid,1)
	doSendMagicEffect({x=219, y=1041, z=7, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end

Also, when i run the server, the console shows this ::
Code:
Lua Script Error: [CreatureScript Interface]
data/creaturescripts/scripts/login.lua

luaRegisterCreatureEvent(). Creature not found
The portal for demodras works, but the custom creature i made Xief doesnt.
 
I have problem to remover teleport. I use TFS 0.3.4PL2.
Please help.

PHP:
function onDeath(cid, corpse, killer)

	registerCreatureEvent(cid, "inquisitionPortals")

	local creaturename = getCreatureName(cid)

--- positions where the teleports will be created:

	local azerus_in_pos = {x=961, y=926, z=9, stackpos=2} 

--- positions where the teleports will be teleported you:

	local azerus_to_pos = {x=1063, y=1008, z=8, stackpos=1}

	local time_to_pass = 180 -- in seconds
	local tpID = 1387
	local doEffect = CONST_ME_TELEPORT
	local message = "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during his time or the teleporter will disappear"

	if creaturename == 'Azerus' then

			teleport = doCreateTeleport(tpID, azerus_to_pos, azerus_in_pos)

			doSendMagicEffect(azerus_in_pos, doEffect)

			doCreatureSay(cid, message, TALKTYPE_ORANGE_1)

			addEvent(removeTeleportInAzerus, time_to_pass * 1000)

	
		end 
end

function removeTeleportInAzerus()
	if getThingfromPos({x=961, y=926, z=9, stackpos=2}).itemid == 1387 then
	doRemoveItem(getThingfromPos({x=961, y=926, z=9, stackpos=2}).uid,1)
	doSendMagicEffect({x=961, y=926, z=9, stackpos=1}, CONST_ME_POFF)
	return TRUE
	end
end
 
In rl-tibia, when you enter the tp, you will get to the beginning (tp-room) if you didn't kill the boss. If you did kill the boss, you will get to the next place.
That's what this script does.

I also have a script that checks if you have entered tp after boss was killed. If you did, you will be able to enter the tp in "tp-room".


creaturescripts\scripts\Login.lua
Code:
registerCreatureEvent(cid, "Ushuriel")


creaturescripts\creaturescripts.xml
Code:
<event type="death" name="Ushuriel" event="script" value="Ushuriel.lua"/>

creaturescripts\scripts\Ushuriel.lua
Code:
function onDeath(cid, Killer)
  registerCreatureEvent(cid, "Ushuriel")
  local creaturename = getCreatureName(cid)

  if isMonster(cid) == TRUE then
    if creaturename ~= Ushuriel then
      setGlobalStorageValue(45001, 1)
      doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during this time or you have to kill the boss again.", TALKTYPE_ORANGE_1)
      addEvent(setGlobalStorageValue, 180000, 45001, -1)
    end
  end
end



movements\movements.xml
Code:
<movevent type="StepIn" actionid="45001" event="script" value="Ushuriel.lua" />


movements\scripts\Ushuriel.lua
Just add the decided action id on the ground/tp/item you stepIn.
Code:
function onStepIn(cid, item, frompos, item2, topos) 
success = {x=33069, y=31782, z=13}
faliure = {x=33168, y=31712, z=14}
status = getGlobalStorageValue(cid, 45001)

  if item.actionid == 45001 then
    if status == 1 then
      if isPlayer(cid) == TRUE then
        doTeleportThing(cid, success)
        setPlayerStorageValue(cid, 45001, 1)
        doSendMagicEffect(success, CONST_ME_ENERGYAREA)
      end
    else
      if isPlayer(cid) == TRUE then
        doTeleportThing(cid, faliure)
        doSendMagicEffect(faliure, CONST_ME_ENERGYAREA)
      end
    end
  end 
  return TRUE
end
 
Everything working just fine, I kill the boss, his body turns into a teleporter, I enter the teleporter and it takes me to the next room. The only problem is that the TP isn't dissapearing after 180 seconds. Using tfs 0.3.2

PHP:
	local config = {
	message = "Go into the teleporter in 3 minutes, else it will disappear.",
	timeToRemove = 180, -- seconds
	teleportId = 1387,
	bosses = {
		["Morgaroth"] = { x = 1932, y = 645, z = 4 },
		["Ghazbaran"] = { x = 1932, y = 645, z = 4 },
		["Zoralurk"] = { x = 1932, y = 645, z = 4 }
	
	}
}

local function removal(position)
	position.stackpos = 1
	if getThingfromPos(position).itemid == config.teleportId then
		doRemoveItem(getThingfromPos(position).uid)
	end
	return TRUE
end

function onDeath(cid, corpse, killer)
	registerCreatureEvent(cid, "trianglePortals")
	local position = getCreaturePosition(cid)
	
	for name, pos in pairs(config.bosses) do
		if name == getCreatureName(cid) then
			teleport = doCreateTeleport(config.teleportId, pos, position)
			doCreatureSay(cid, config.message, TALKTYPE_ORANGE_1)
			addEvent(removal, config.timeToRemove * 1000, position)
		end
	end
	return TRUE
end
 
Code:
[31/05/2009 18:10:09] Lua Script Error: [CreatureScript Interface] 
[31/05/2009 18:10:09] data/creaturescripts/scripts/trianglePortals.lua:onDeath

[31/05/2009 18:10:09] luaGetThingFromPos(). Tile not found

[31/05/2009 18:10:09] Lua Script Error: [CreatureScript Interface] 
[31/05/2009 18:10:09] data/creaturescripts/scripts/trianglePortals.lua:onDeath

[31/05/2009 18:10:09] luaDoRemoveItem(). Item not found


EDIT: Okay I just solved it changing the stackpos=2 to stackpos=1
 
Last edited:
Lol no teleport is being created!!!

Just stands you have 30 secounds to enter the teleport!!
 
:( dont work in my tfs 0.2.3
and no have errors in console :S
wtf?
when boss die dont make teleport =/
 
Back
Top