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

why its not removing tp?

CheatsBCN

New Member
Joined
Mar 6, 2012
Messages
131
Reaction score
1
this is the script im using for making a tp after killing demodras, but when it tryes to remove te tp it says

[02/10/2012 23:47:27] LuaScriptInterface::luaDoRemoveItem(). Item not found
[02/10/2012 23:47:27] stack traceback:
[02/10/2012 23:47:27] [C]: ?



this is the script thanks!!!!!!!!!!!!


PHP:
function onKill(cid, target, lastHit)
	local m = {
		["Demodras"] = {
			time = 30, -- Seconds
			to = { x = 1146, y = 1101, z = 7 }, -- Where Teleport Goes
			tp = { x = 1146, y = 1101, z = 6 } -- Where Teleport Creates
		}
	}
	local monster = m[getCreatureName(target)]
	local get = getThingfromPos(monster.tp)
	if(monster) then
		doCreatureSay(cid, "You have " .. monster.time .. " seconds to go downstairs!", TALKTYPE_ORANGE_1)
		broadcastMessage("Demodras was killed by " ..getCreatureName(cid).. "!", type)
		doCreateTeleport(1387, monster.to, monster.tp)
		addEvent(doRemoveItem, (1000*30), get.uid, 1)
	end
	return true
end
 
ur missing the stackpos
think of the coordenates as a street address, you get to the address, but you come across a building with 10 floors, how do you know which one you want to go to?
the stackpos is exactly that, since each position can have more then 1 item, you need the stackpos to indicate which item you want

- - - Updated - - -

Moved to Support
 
for example:
Lua:
to = { x = 1146, y = 1101, z = 7, stackpos = 1}
you can check what each stackpos means in one of the files that comes in the docs folder when you download TFS :)
 
im using this now

PHP:
function onKill(cid, target, lastHit)
	local m = {
		["Demodras"] = {
			time = 30, -- Seconds
			to = { x = 1146, y = 1101, z = 7 }, -- Where Teleport Goes
			tp = { x = 1146, y = 1101, z = 6, stackpos = 1 } -- Where Teleport Creates
		}
	}
	local monster = m[getCreatureName(target)]
	local get = getThingfromPos(monster.tp)
	if(monster) then
		doCreatureSay(cid, "You have " .. monster.time .. " seconds to go downstairs!", TALKTYPE_ORANGE_1)
		broadcastMessage("Demodras was killed by " ..getCreatureName(cid).. "!", type)
		doCreateTeleport(1387, monster.to, monster.tp)
		addEvent(doRemoveItem, (1000*30), get.uid, 1)
	end
	return true
end


and still not working



error:
ç


[03/10/2012 01:05:06] Lua Script Error: [CreatureScript Interface]
[03/10/2012 01:05:06] in a timer event called from:
[03/10/2012 01:05:06] data/creaturescripts/scripts/Demodras.lua:eek:nKill
[03/10/2012 01:05:06] LuaScriptInterface::luaDoRemoveItem(). Item not found
[03/10/2012 01:05:06] stack traceback:
[03/10/2012 01:05:06] [C]: ?
 
and this way


PHP:
function onKill(cid, target, lastHit)
	local m = {
		["Demodras"] = {
			time = 30, -- Seconds
			to = { x = 1146, y = 1101, z = 7 }, -- Where Teleport Goes
			tp = { x = 1146, y = 1101, z = 6 } -- Where Teleport Creates
		}
	}
	local monster = m[getCreatureName(target)]
	if(monster) then
		doCreatureSay(cid, "You have " .. monster.time .. " seconds to go into de teleport!", TALKTYPE_ORANGE_1)
		broadcastMessage("Demodras was killed by " ..getCreatureName(cid).. "!", type)
		doCreateTeleport(1387, monster.to, monster.tp)
		local get = getTileItemById(monster.tp)
		addEvent(doRemoveItem, (1000*30), get.uid, 1)
	end
	return true
end


returns this error:

[03/10/2012 01:10:10] Lua Script Error: [CreatureScript Interface]
[03/10/2012 01:10:10] data/creaturescripts/scripts/Demodras.lua:eek:nKill
[03/10/2012 01:10:10] attempt to index a number value
[03/10/2012 01:10:10] stack traceback:
[03/10/2012 01:10:10] [C]: ?
[03/10/2012 01:10:10] [C]: in function 'getTileItemById'
[03/10/2012 01:10:10] data/creaturescripts/scripts/Demodras.lua:14: in function <data/creaturescripts/scripts/Demodras.lua:1>

- - - Updated - - -

used all noone working =(((((((((((((((((
 
This script should do the same thing yours does, except this one works for me 100% I use it for pythius and also for ashmunrah final tp to access helmet of the ancients room.


Pythius_the_rotten_teleport.lua

Lua:
--- Created by Darkhaos
 
function onDeath(cid, corpse, killer)
 
registerCreatureEvent(cid, "Ashmunrah Teleport")
 
local creaturename = getCreatureName(cid)
local in_pos = {x=33179, y=32884, z=11, stackpos=2} --- Position where tp is created
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=33198, y=32880, z=11, stackpos=1} --- To position tp leads player
local time_to_pass = 60 -- in seconds
local tpID = 1387 --- Don't change
 
if creaturename == 'Ashmunrah' then
 
teleport = doCreateTeleport(tpID, to_pos, in_pos)
 
doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
 
doCreatureSay(cid, "You have 60 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, (1000*time_to_pass))


end
end
 
function removeTeleport()
if getThingfromPos({x=33179, y=32884, z=11, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=33179, y=32884, z=11, stackpos=1}).uid,1)
doSendMagicEffect({x=33179, y=32884, z=11, stackpos=15}, CONST_ME_POFF)
return TRUE
end
end

creaturescripts.xml
Lua:
    <!-- Pythius the rotten -->
    <event type="death" name="Pythius the rottenTeleport" script="Pythius_the_rotten_teleport.lua"/>

Add this in the monsters .xml for example...
Lua:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Pythius the rotten" nameDescription="a Pythius the rotten" race="undead" experience="100" speed="300" manacost="0">
  <health now="8350" max="8350"/>
  <look type="231" corpse="6306"/>
  <targetchange interval="5000" chance="8"/>
  <strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="1"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="1"/>
    <flag canpushcreatures="1"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="0"/>
  </flags>
<script>
<event name="Pythius the rottenTeleport"/>
</script>
  <attacks>
    <attack name="melee" interval="2000" skill="95" attack="95"/>

    <attack name="fire" interval="2000" chance="20" range="7" radius="4" target="1" min="-300" max="-395">
      <attribute key="shootEffect" value="fire"/>
      <attribute key="areaEffect" value="redspark"/>
    </attack>

    <attack name="death" interval="3000" chance="20" range="7" min="-0" max="-600">
      <attribute key="shootEffect" value="suddendeath"/>
    </attack>

    <attack name="poison" interval="2000" chance="20" range="7" radius="4" target="1" min="-120" max="-390">
      <attribute key="shootEffect" value="poison"/>
      <attribute key="areaEffect" value="poison"/>
    </attack>

    <attack name="poison" interval="1000" chance="10" range="7" min="-50" max="-180">
      <attribute key="shootEffect" value="poison"/>
      <attribute key="areaEffect" value="poison"/>
    </attack>

    <attack name="fire" interval="4000" chance="25" length="8" spread="3" min="-500" max="-600">
      <attribute key="areaEffect" value="firearea"/>
    </attack>

    <attack name="poison" interval="2000" chance="23" length="8" spread="3" min="-200" max="-685">
      <attribute key="areaEffect" value="poison"/>
    </attack>

    <attack name="lifedrain" interval="3000" chance="25" length="8" spread="3" min="-300" max="-600">
      <attribute key="areaEffect" value="greenshimmer"/>
    </attack>

  </attacks>
  <defenses armor="35" defense="30">
  </defenses>
    <elements>
        <element physicalPercent="10"/>
        <element icePercent="10"/>
        <element holyPercent="-10"/>
    </elements>
  <immunities>
    <immunity death="1"/>
    <immunity earth="1"/>
    <immunity fire="1"/>
    <immunity drown="1"/>
    <immunity lifedrain="1"/>
    <immunity paralyze="1"/>
    <immunity invisible="1"/>
  </immunities>
  <summons maxSummons="2">
    <summon name="Undead Gladiator" interval="1000" chance="8"/>
  </summons>
  <voices interval="5000" chance="10">
    <voice sentence="YOU'LL NEVER GET MY TREASURE!"/>

  </voices>

</monster>
 
Back
Top