• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

problem with movement script

christiandb

Member
Joined
Feb 5, 2008
Messages
2,469
Reaction score
5
Location
010
Code:
function onStepIn(cid, item, position, fromPosition)

switch1pos = {x=32310, y=31975, z=13, stackpos=1}
switch2pos = {x=32310, y=31976, z=13, stackpos=1}
switch3pos = {x=32312, y=31975, z=13, stackpos=1}
switch4pos = {x=32312, y=31976, z=13, stackpos=1}
switch5pos = {x=32314, y=31975, z=13, stackpos=1}
switch6pos = {x=32314, y=31976, z=13, stackpos=1}


getswitch1 = getThingfromPos(switch1pos)
getswitch2 = getThingfromPos(switch2pos)
getswitch3 = getThingfromPos(switch3pos)
getswitch4 = getThingfromPos(switch4pos)
getswitch5 = getThingfromPos(switch5pos)
getswitch6 = getThingfromPos(switch6pos)

if item.uid == 7504 and item.itemid == 1397 and getPlayerStorageValue(cid,7500) == 1 and
getswitch1.itemid == 1946 and
getswitch2.itemid == 1946 and
getswitch3.itemid == 1946 and
getswitch4.itemid == 1946 and
getswitch5.itemid == 1945 and
getswitch6.itemid == 1945 then

setPlayerStorageValue(cid,7500,2)

else 	doPlayerSendCancel(cid,"You don't have completed the required seals or the levers aren't on the right place.")

end

return 1

end

Code:
[05/12/2008 03:20:19] Lua Script Error: [MoveEvents Interface] 
[05/12/2008 03:20:20] data/movements/scripts/banshee/banshee2.lua:onStepIn

[05/12/2008 03:20:20] attempt to index a nil value
[05/12/2008 03:20:20] stack traceback:
[05/12/2008 03:20:20] 	[C]: in function 'getThingfromPos'
[05/12/2008 03:20:20] 	data/movements/scripts/banshee/banshee2.lua:17: in function <data/movements/scripts/banshee/banshee2.lua:1>

using tfs 0.3 alpha 4.
any idea's why it's bugged?

PS: it is checking levers
 
Last edited:
ill try it but i gues it wont work :P

EDIT: didnt work

[05/12/2008 03:55:41] Lua Script Error: [MoveEvents Interface]
[05/12/2008 03:55:41] data/movements/scripts/banshee/banshee2.lua:onStepIn

[05/12/2008 03:55:41] data/movements/scripts/banshee/banshee2.lua:19: attempt to index global 'getswitch1' (a number value)
[05/12/2008 03:55:41] stack traceback:
[05/12/2008 03:55:41] data/movements/scripts/banshee/banshee2.lua:19: in function <data/movements/scripts/banshee/banshee2.lua:1>
 
Code:
local switches = {
	switch1pos = { x = 32310, y = 31975, z = 13, stackpos = 1 },
	switch2pos = { x = 32310, y = 31976, z = 13, stackpos = 1 },
	switch3pos = { x = 32312, y = 31975, z = 13, stackpos = 1 },
	switch4pos = { x = 32312, y = 31976, z = 13, stackpos = 1 },
	switch5pos = { x = 32314, y = 31975, z = 13, stackpos = 1 },
	switch6pos = { x = 32314, y = 31976, z = 13, stackpos = 1 }
}

function onStepIn(cid, item, position, fromPosition)
	local getSwitch1 = getThingfromPos(switches.switch1pos)
	local getSwitch2 = getThingfromPos(switches.switch2pos)
	local getSwitch3 = getThingfromPos(switches.switch3pos)
	local getSwitch4 = getThingfromPos(switches.switch4pos)
	local getSwitch5 = getThingfromPos(switches.switch5pos)
	local getSwitch6 = getThingfromPos(switches.switch6pos)

	if item.uid == 7504 and item.itemid == 1397 then 
		if getPlayerStorageValue(cid,7500) == 1 then
			if getSwitch1.itemid == 1946 and getSwitch2.itemid == 1946 and getSwitch3.itemid == 1946 and getSwitch4.itemid == 1946 and getSwitch5.itemid == 1945 and getSwitch6.itemid == 1945 then
				setPlayerStorageValue(cid, 7500, 2)
			else
				doPlayerSendCancel(cid, "Switches are not on the right place.")
			end
		else
			doPlayerSendCancel(cid, "You haven't completed the required seal.")
		end
	end
	return TRUE
end
 
Back
Top