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

MoveEvent Antytrap Tile

narko

vertrauenswürdig ~
Joined
Oct 19, 2008
Messages
1,317
Solutions
2
Reaction score
131
Location
Unknown
Anty Trap Tile
./data/movements/Movement.xml
Code:
	<movevent type="StepIn" actionid="15123" event="script" value="traptile.lua"/>
	<movevent type="StepOut" actionid="15133" event="script" value="traptile.lua"/>

./data/movements/scrips/traptile.lua :
Code:
local session, events = 
	15 * 60, {}

function train(cid, time)
    if isPlayer(cid) then
		if os.time() - time >= session then
			events[getPlayerGUID(cid)] = nil
			doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -5105, -10250, CONST_ME_NONE)
			doTeleportThing(cid, getPlayerMasterPos(cid))
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your trap tile has been expire. Thanks for playing Neroxia.")
		else
			events[getPlayerGUID(cid)] = addEvent(train, 3000, cid, time)
			local v = getThingPos(cid)
			doSendAnimatedText(v, 'Trap Tile!', TEXTCOLOR_RED)
			doTargetCombatHealth(0, cid, COMBAT_PHYSICALDAMAGE, -105, -250, CONST_ME_NONE)
			doSendMagicEffect(v, CONST_ME_MAGIC_GREEN)
		end
    end
end

function onStepIn(cid, item, pos, fromPos)
	if isPlayer(cid) then
		train(cid, os.time())
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Warning!You are in trap tile.")
	end
end

function onStepOut(cid, item, pos, fromPos)
	if isPlayer(cid) then
		local v = getPlayerGUID(cid)
		if v then
			stopEvent(events[v])
			events[v] = nil
		end
	end
end
 
say what it does? and how to use it and where :)
anyway good :)
 
Res post

this script working fine but have this error
tfs 1.2
Lua Script Error: [MoveEvents Interface]
data/movements/scripts/traptile.lua:eek:nStepIn
LuaScriptInterface::luaAddEvent(). Argument #3 is unsafe
stack traceback:
[C]: in function 'addEvent'
data/movements/scripts/traptile.lua:12: in function 'train'
data/movements/scripts/traptile.lua:23: in function <data/movements/scri
pts/traptile.lua:21>
 
Last edited:
Back
Top