• 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 trap code

kira178

Member
Joined
Jun 24, 2008
Messages
290
Reaction score
5
Hello, any1 can help me find out where's my problem in this code:
(sorry if i have noob action >.< because im newbie)

Code:
[14/06/2010 00:45:31] [Error - LuaScriptInterface::loadFile] data/movements/scripts/swicthtrap.lua:1: unexpected symbol near 'ï'
[14/06/2010 00:45:31] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/swicthtrap.lua)
[14/06/2010 00:45:31] data/movements/scripts/swicthtrap.lua:1: unexpected symbol near 'ï'
[14/06/2010 00:45:31] [Error - LuaScriptInterface::loadFile] data/movements/scripts/warlocktrap.lua:1: unexpected symbol near 'ï'
[14/06/2010 00:45:31] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/warlocktrap.lua)
[14/06/2010 00:45:31] data/movements/scripts/warlocktrap.lua:1: unexpected symbol near 'ï'
[14/06/2010 00:45:31] [Error - LuaScriptInterface::loadFile] data/movements/scripts/warlocktrap.lua:1: unexpected symbol near 'ï'
[14/06/2010 00:45:31] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/warlocktrap.lua)
[14/06/2010 00:45:31] data/movements/scripts/warlocktrap.lua:1: unexpected symbol near 'ï'

And this is my 2 code i tried make:

Code:
local spawnpos = {x=32211, y=31842, z=7}
local spawnpos1 = {x=32219, y=31842, z=7}
			--player1pos = {x=32215, y=31838, z=15, stackpos=1},
			--player2pos = {x=32216, y=31838, z=15, stackpos=1}

function onStepIn(cid, item, pos, fromPos)

	if item.actionid == 14016 or item.actionid == 14017 then
	 if isPlayer(cid) then
		doSummonCreature("Warlock", spawnpos)
		doSummonCreature("Warlock", spawnpos1)
		doSendMagicEffect(spawnpos, CONST_ME_ENERGYAREA)
		doSendMagicEffect(spawnpos1, CONST_ME_ENERGYAREA)
		doTransformItem(item.uid, item.itemid -1)
	 end
	end
end

Code:
local config = {
				switches = {
							[1] = {pos = {x=32220, y=31843, z=15, stackpos=1}},
							[2] = {pos = {x=32220, y=31845, z=15, stackpos=1}},
							[3] = {pos = {x=32220, y=31844, z=15, stackpos=1}},
							[4] = {pos = {x=32220, y=31842, z=15, stackpos=1}},
							[5] = {pos = {x=32220, y=31846, z=15, stackpos=1}}
						   },
				correct = {
							[1] = {id = 1945},
							[2] = {id = 1945},
							[3] = {id = 1945},
							[4] = {id = 1945},
							[5] = {id = 1945}
					      },
				wallid = 1355,
				wallpos = {x=32216, y=31851, z=15},
				check = {
						 [1] = false,
						 [2] = false,
						 [3] = false,
						 [4] = false,
						 [5] = false
						},
				reset = 1
			   }
 
function onStepIn(cid, item, pos, fromPos)
 	if isPlayer(cid) == TRUE then
		for i = 1, config.switches do
			if getThingFromPos(config.switches[i].pos).itemid == config.correct[i].id then
				config.check[i] = true
			else
				config.check[i] = false
			end
		end
 	if (config.check[1] and config.check[2] and config.check[3] and config.check[4]) == TRUE then
			doRemoveItem(getThingFromPos(config.wallpos))
		else
		addEvent(resettime, config.reset * 1000, item)
		end
	end
end

function resettime()
doCreateItem(config.switches, config.wallpos)
end
 
well... you need to recreate the scripts under a new filename. i'm not sure why some scripts get corrupted occasionally :/
 
almost so but i got solve first problem and worked with first script:) just second now, im so new then it has some hard, anyway :P i got solution. Thanks
 
Back
Top