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

Script

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
what is wrong with this ?

Code:
[5:37:08.543] [Error - CreatureScript Interface] 
[5:37:08.543] data/creaturescripts/scripts/demonOakLogout.lua:onLogout
[5:37:08.543] Description: 
[5:37:08.543] (luaGetCreatureStorage) Creature not found

[5:37:08.543] [Error - CreatureScript Interface] 
[5:37:08.543] data/creaturescripts/scripts/demonOakLogout.lua:onLogout
[5:37:08.543] Description: 
[5:37:08.543] data/creaturescripts/scripts/demonOakLogout.lua:3: attempt to compare number with boolean
[5:37:08.543] stack traceback:
[5:37:08.543] 	data/creaturescripts/scripts/demonOakLogout.lua:3: in function <data/creaturescripts/scripts/demonOakLogout.lua:1>

[5:37:08.544] [Error - CreatureScript Interface] 
[5:37:08.544] domodlib('teamFunctions')
[5:37:08.544]  
[5:37:08.544] function onLogout(cid)
[5:37:08.544] 	clearTeamEventStorages(cid)
[5:37:08.544] 	if thereIsAWinner() then
[5:37:08.544] 		endTeamEvent("KO")
[5:37:08.544] 	end
[5:37:08.544] 	return true
[5:37:08.544] end
[5:37:08.544]  
[5:37:08.544] :onLogout
[5:37:08.544] Description: 
[5:37:08.544] (luaGetThingPosition) Thing not found

[5:37:08.544] [Error - CreatureScript Interface] 
[5:37:08.544] domodlib('teamFunctions')
[5:37:08.544]  
[5:37:08.544] function onLogout(cid)
[5:37:08.544] 	clearTeamEventStorages(cid)
[5:37:08.544] 	if thereIsAWinner() then
[5:37:08.544] 		endTeamEvent("KO")
[5:37:08.544] 	end
[5:37:08.544] 	return true
[5:37:08.544] end
[5:37:08.544]  
[5:37:08.544] :onLogout
[5:37:08.544] Description: 
[5:37:08.544] data/lib/032-position.lua:2: attempt to index local 'position' (a boolean value)
[5:37:08.544] stack traceback:
[5:37:08.544] 	data/lib/032-position.lua:2: in function <data/lib/032-position.lua:1>
[5:37:08.544] 	(tail call): ?
[5:37:08.544] 	[string "domodlib('teamSetting')..."]:234: in function 'clearTeamEventStorages'
[5:37:08.544] 	[string "LuaInterface::loadBuffer"]:4: in function <[string "LuaInterface::loadBuffer"]:3>


demonOakLogout
Code:
function onLogout(cid)

        if getPlayerStorageValue(cid, 36901) > 0 and getPlayerStorageValue(cid, 35700) < 1 then
                doPlayerSetStorageValue(cid, 36901, 0)
                return TRUE
        end
        return TRUE
end

------
032-position
Code:
function isInRange(position, fromPosition, toPosition)
	return position.x >= fromPosition.x and position.y >= fromPosition.y and position.z >= fromPosition.z and position.x <= toPosition.x and position.y <= toPosition.y and position.z <= toPosition.z
end

function getDistanceBetween(fromPosition, toPosition)
	local x, y = math.abs(fromPosition.x - toPosition.x), math.abs(fromPosition.y - toPosition.y)
	local diff = math.max(x, y)
	if(fromPosition.z ~= toPosition.z) then
		diff = diff + 9 + 6
	end

	return diff
end

function getDirectionTo(pos1, pos2)
	local dir = NORTH
	if(pos1.x > pos2.x) then
		dir = WEST
		if(pos1.y > pos2.y) then
			dir = NORTHWEST
		elseif(pos1.y < pos2.y) then
			dir = SOUTHWEST
		end
	elseif(pos1.x < pos2.x) then
		dir = EAST
		if(pos1.y > pos2.y) then
			dir = NORTHEAST
		elseif(pos1.y < pos2.y) then
			dir = SOUTHEAST
		end
	else
		if(pos1.y > pos2.y) then
			dir = NORTH
		elseif(pos1.y < pos2.y) then
			dir = SOUTH
		end
	end

	return dir
end

function getCreatureLookPosition(cid)
	return getPositionByDirection(getThingPosition(cid), getCreatureLookDirection(cid))
end

function getPositionByDirection(position, direction, size)
	local n = size or 1
	if(direction == NORTH) then
		position.y = position.y - n
	elseif(direction == SOUTH) then
		position.y = position.y + n
	elseif(direction == WEST) then
		position.x = position.x - n
	elseif(direction == EAST) then
		position.x = position.x + n
	elseif(direction == NORTHWEST) then
		position.y = position.y - n
		position.x = position.x - n
	elseif(direction == NORTHEAST) then
		position.y = position.y - n
		position.x = position.x + n
	elseif(direction == SOUTHWEST) then
		position.y = position.y + n
		position.x = position.x - n
	elseif(direction == SOUTHEAST) then
		position.y = position.y + n
		position.x = position.x + n
	end

	return position
end

function doComparePositions(position, positionEx)
	return position.x == positionEx.x and position.y == positionEx.y and position.z == positionEx.z
end

function getArea(position, x, y)
	local t = {}
	for i = (position.x - x), (position.x + x) do
		for j = (position.y - y), (position.y + y) do
			table.insert(t, {x = i, y = j, z = position.z})
		end
	end

	return t
end

function Position(x, y, z, stackpos)
	local position = {x = 0, y = 0, z = 0}
	if(isNumeric(x .. y .. z)) then
		position = {x = x, y = y, z = z}
		if(isNumeric(stackpos)) then
			position.stackpos = stackpos
		end
	end

	return position
end
 
Probably version mismatch or a bad install.


"attempt to index local 'position' (a boolean value)"
- means the code expects variable "position" to be an indexable Lua Table, but it's actually boolean (value is either "true" or false")

"attempt to compare number with boolean"
- numerical comparison (>, <, etc) on a boolean

"domodlib('teamSetting')"
- This one's OT/TFS -AFAIK it loads and runs a Lua module
 
Back
Top