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

Solved Go to/Leave City

VirrageS

←•†ĿuĀ && ©¤¤•→
Joined
May 30, 2010
Messages
984
Reaction score
63
Location
Poland
Hello everyone :)

I have problem with scrpit which sending message when you StepOut from tile with action id = 4486.

Here is scrpit:

Lua:
function onStepOut(cid, item, position, fromPosition)
 local message = "Welcome in Dsasd City"
 local leave = "You are leaving Dsasd City"
 local dirx = getCreatureLookDirection(cid)
	if isPlayer(cid) and dirx = NORTH then
		doSendMagicEffect(getCreaturePosition(cid),27)
		doPlayerSendTextMessage(cid,19,message)
	elseif isPlayer(cid) and dirx = SOUTH then
		doSendMagicEffect(getCreaturePosition(cid),27)
		doPlayerSendTextMessage(cid,19,leave)
	else
		return false
	end
end

Where is problem?? :blink:

Here !!!:
So I'm not sure that I good use function "getCreatureLookDirection"



If someone can convert this script that it will works i will be very thankful ;)
P.S. I'm using TFS 0.3.6
 
Last edited:
use an uniqueid instead, and test this one
Lua:
local message = 'Welcome in Dsasd City'
local leave = 'You are leaving Dsasd City'

function onStepOut(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    local dirx = getCreatureLookDirection(cid)
    if isPlayer(cid) and dirx == 0 then
        doSendMagicEffect(getThingPos(cid),27)
        doPlayerSendTextMessage(cid,19,message)
    elseif isPlayer(cid) and dirx == 2 then
        doSendMagicEffect(getThingPos(cid),27)
        doPlayerSendTextMessage(cid,19,leave)
    end
    return true
end
 
Back
Top