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

Need to get this script working, check it please!!! ;o

Wezza

lua nOOb
Joined
May 31, 2008
Messages
2,278
Reaction score
31
Here's the error:

Code:
data/actions/scripts/vip/lever_roll.lua:onUse
Description: 
data/actions/scripts/vip/lever_roll.lua:7: attempt to call global 'comparePos' (a nil value)
stack traceback:
data/actions/scripts/vip/lever_roll.lua:7: in function <data/actions/scripts/vip/lever_roll.lua:5>


data/actions/scripts/vip/lever_buy.lua:onUse
Description: 
data/actions/scripts/vip/lever_buy.lua:25: attempt to call global 'comparePos' (a nil value)
stack traceback:
[data/actions/scripts/vip/lever_buy.lua:25: in function <data/actions/scripts/vip/lever_buy.lua:14>

Here's the script: (Lever_Buy)

Code:
local itemList = {
	[2261] = {6000, 15},
	[2293] = {2000, 20},
	[2268] = {5000, 40},
	[2273] = {2000, 100},
	[2173] = {40000, 1},
	[2304] = {2000, 30},
	[2305] = {7000, 5},
	[2313] = {2000, 50},
	[2265] = {1000, 100}

}
 
function onUse(cid, item)

	if item.itemid == 1945 then
		doTransformItem(item.uid, 1946)
	else
		doTransformItem(item.uid, 1945)
	end
	
	local pos = getCreaturePosition(cid)
	local itemid = getThingfromPos({x=pos.x + 3, y=pos.y, z=pos.z, stackpos=2}).itemid
 
 	if comparePos(getCreaturePosition(cid), {x=836,y=702,z=7}) then

Lever (Roll)

Code:
local topPos = {x=839, y=698, z=7} -- first tile of NORTH
local tiles = 9 -- amount of tiles

 
function onUse(cid, item)

 	if comparePos(getCreaturePosition(cid), {x=836,y=702,z=7}) then
		local runes = {}
		for i = 0, (tiles - 1) do
			runes[i + 1] = getThingfromPos({x = topPos.x, y = topPos.y + i, z = topPos.z, stackpos = 2})
		end


picture for more details:
rwhrlw.jpg


side note/

keep in mind this script works great on 8.50, once I tried it on 8.60 it didnt work, just so you know. and not to get far in thinking
thanks in advance.
 
Last edited:
This script is incomplete
LUA:
local itemList = {
	[2261] = {6000, 15},
	[2293] = {2000, 20},
	[2268] = {5000, 40},
	[2273] = {2000, 100},
	[2173] = {40000, 1},
	[2304] = {2000, 30},
	[2305] = {7000, 5},
	[2313] = {2000, 50},
	[2265] = {1000, 100}

}
 
function onUse(cid, item)

	if item.itemid == 1945 then
		doTransformItem(item.uid, 1946)
	else
		doTransformItem(item.uid, 1945)
	end
	
	local pos = getCreaturePosition(cid)
	local itemid = getThingfromPos({x=pos.x + 3, y=pos.y, z=pos.z, stackpos=2}).itemid
 
 	if comparePos(getCreaturePosition(cid), {x=836,y=702,z=7}) then
 
Sorry for double posting, but just to get this thread notified again so Cyckotitan can check it out.

Cyko, It works now but I need to get it working like this too:

9axtzk.jpg



I want my position look North and not to the east what to do?
 
now I have the mapping changed, the first picture on my first post shows that the things looks horizontal, and I want it to look vertical, how can I get that to work?
 
LUA:
 runes[i + 1] = getThingfromPos({x = topPos.x, y = topPos.y + i, z = topPos.z, stackpos = 2}

to

LUA:
 runes[i + 1] = getThingfromPos({x = topPos.x + i, y = topPos.y, z = topPos.z, stackpos = 2}
 
Back
Top