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

Help Here

Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
188
Location
Venezuela
I made this scripts.. and the scripts create the teleport but.. don't send the message and don't remove the teleport =(

here is...

Code:
function onDeath(cid, corpse, killer)

	registerCreatureEvent(cid, "ushurielStorage")

	local creaturename = getCreatureName(cid)
	local to_pos = {x=588, y=1086, z=7, stackpos=1} 
	local in_pos = {x=859, y=837, z=6, stackpos=1} 
	local TIME_TO_REMOVE = 180 -- in seconds

    if creaturename == 'Ushuriel' then
	local text_pos = getCreaturePosition(creaturename)

		teleport = doCreateTeleport(1387, to_pos, in_pos)

		doSendMagicEffect(in_pos, CONST_ME_TELEPORT)

		doCreatureSayWithDistance(text_pos, "You now have 3 minutes to exit this room through 

the teleporter. It will bring you to the next room only during his time", TALKTYPE_ORANGE_1)

		addEvent(doRemoveItem, TIME_TO_REMOVE * 100, teleport)

	
	end 
end

The following errors... :(
Code:
[26/11/2008  09:50:11] Lua Script Error: [CreatureScript Interface] 
[26/11/2008  09:50:11] data/creaturescripts/scripts/ushuriel_teleport.lua:onDeath

[26/11/2008  09:50:11] luaGetCreaturePosition(). Creature not found

[26/11/2008  09:50:11] Lua Script Error: [CreatureScript Interface] 
[26/11/2008  09:50:11] data/creaturescripts/scripts/ushuriel_teleport.lua:onDeath

[26/11/2008  09:50:11] luaGetCreaturePosition(). Creature not found

[26/11/2008  09:50:11] Lua Script Error: [CreatureScript Interface] 
[26/11/2008  09:50:11] data/creaturescripts/scripts/ushuriel_teleport.lua:onDeath

[26/11/2008  09:50:11] data/global.lua:604: attempt to index a number value
[26/11/2008  09:50:11] stack traceback:
[26/11/2008  09:50:11] 	data/global.lua:604: in function 'doCreatureSayWithDistance'
[26/11/2008  09:50:11] 	data/creaturescripts/scripts/ushuriel_teleport.lua:21: in function <data/creaturescripts/scripts/ushuriel_teleport.lua:5>


Help me please
 
Change this:
local text_pos = getCreaturePosition(creaturename)
to
local text_pos = getCreaturePosition(cid)

Because 'cid' is the killed monster.
 
Change this:
local text_pos = getCreaturePosition(creaturename)
to
local text_pos = getCreaturePosition(cid)

Because 'cid' is the killed monster.

ok.. i have changed that but.. don't work yet =(

Code:
[26/11/2008  17:47:59] Lua Script Error: [CreatureScript Interface] 
[26/11/2008  17:47:59] data/creaturescripts/scripts/ushuriel_teleport.lua:onDeath

[26/11/2008  17:47:59] luaGetCreaturePosition(). Creature not found

[26/11/2008  17:47:59] Lua Script Error: [CreatureScript Interface] 
[26/11/2008  17:47:59] data/creaturescripts/scripts/ushuriel_teleport.lua:onDeath

[26/11/2008  17:47:59] data/global.lua:604: attempt to index a number value
[26/11/2008  17:47:59] stack traceback:
[26/11/2008  17:47:59] 	data/global.lua:604: in function 'doCreatureSayWithDistance'
[26/11/2008  17:47:59] 	data/creaturescripts/scripts/ushuriel_teleport.lua:22: in function <data/creaturescripts/scripts/ushuriel_teleport.lua:5>

and the teleport don't disappear =(
 
Back
Top