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

Monsters can enter to TP

ligus

New Member
Joined
Apr 26, 2010
Messages
253
Reaction score
0
Hey, I have problem with this part of script:
Code:
if item.actionid == 9106 then
	doTeleportThing(cid,thais)
	doSendMagicEffect(getCreaturePosition(cid),17)

How to make that monsters couldn't be able to enter the teleport?
 
Code:
function onStepIn(cid, item, pos)

local thais = {x=32784, y=31178, z=9}
local carlin = {x=32783, y=31173, z=10}
local venore = {x=32778, y=31171, z=14}

    if item.actionid == 9105 then
		doTeleportThing(cid,carlin)
		doSendMagicEffect(getCreaturePosition(cid),17)
    else
[COLOR="Red"]    if item.actionid == 9106 then
	if isPlayer(cid) then
		doTeleportThing(cid,thais)
		doSendMagicEffect(getCreaturePosition(cid),17)
	end[/COLOR]
    else
	if item.actionid == 24061 then
		doTeleportThing(cid,venore)
		doSendMagicEffect(getCreaturePosition(cid),48)
        end
    return 1
end 
end
end

Monsters can still enter to TP :/
 
Code:
local t = {
	[9105] = {x=32783, y=31173, z=10},
	[9106] = {x=32784, y=31178, z=9},
	[24061] = {x=32778, y=31171, z=14},
}
function onStepIn(cid, item, position, fromPosition)
	return doSendMagicEffect(position, CONST_ME_MORTAREA) and doTeleportThing(cid, isPlayer(cid) == TRUE and t[item.actionid] or fromPosition) and doSendMagicEffect(getThingPos(cid), CONST_ME_MORTARE)
end
 
Code:
local t = {
	[9105] = {x=32783, y=31173, z=10},
	[9106] = {x=32784, y=31178, z=9},
	[24061] = {x=32778, y=31171, z=14},
}
function onStepIn(cid, item, position, fromPosition)
	return doSendMagicEffect(position, CONST_ME_MORTAREA) and doTeleportThing(cid, isPlayer(cid) == TRUE and t[item.actionid] or fromPosition) and doSendMagicEffect(getThingPos(cid), CONST_ME_MORTARE)
end

Code:
CONST_ME_MORTARE

To

Code:
CONST_ME_MORTAREA
 
No no.. both scripts doesnt work

Code:
function onStepIn(cid, item, position, fromPosition, toPosition)
	local pos = {
		{x = 32784, y = 31178, z = 9}, -- Thais
		{x = 32783, y = 31173, z = 10}, -- Carlin
		{x = 32778, y = 31171, z = 14} -- Venore
	}
	if not isPlayer(cid) then
		return false
	end
	if item.actionid == 9105 then
		doTeleportThing(cid, pos[2])
	elseif item.actionid == 9106 then
		doTeleportThing(cid, pos[1])
	elseif item.actionid == 24061 then
		doTeleportThing(cid, pos[3])
	end
	return doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
end
data/movements/scripts/tpcity.lua:12 unexpected symbol near 'if'



Code:
local t = {
	[9105] = {x=32783, y=31173, z=10},
	[9106] = {x=32784, y=31178, z=9},
	[24061] = {x=32778, y=31171, z=14},
}
function onStepIn(cid, item, position, fromPosition)
	return doSendMagicEffect(position, CONST_ME_MORTAREA) and doTeleportThing(cid, isPlayer(cid) == TRUE and t[item.actionid] or fromPosition) and doSendMagicEffect(getThingPos(cid), CONST_ME_MORTAREA)
end
No errors.. but it doesnt work :(
 
Code:
function onStepIn(cid, item, position, fromPosition, toPosition)
	local cfg = {
		[1001] = {{x=32783, y=31173, z=10}, CONST_ME_TELEPORT},
		[1002] = {{x=32784, y=31178, z=9}, CONST_ME_TELEPORT},
		[1003] = {{x=32778, y=31171, z=14}, CONST_ME_TELEPORT}
	}
	local v = cfg[item.actionid]
	return isPlayer(cid) and doTeleportThing(cid, v[1], true) and doSendMagicEffect(getThingPos(cid), v[2])
end
 
Back
Top