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

Of this error left me with a script

Beoz

New Member
Joined
Jun 29, 2009
Messages
3
Reaction score
0
*==========================
[26/08/2009 00:19:07] Lua Script Error: [MoveEvents Interface]
[26/08/2009 00:19:07] data/movements/scripts/tiles.lua:-OnStepIn

[26/08/2009 00:19:07] data/movements/scripts/tiles.lua:99: attempt to compare number with nil
[26/08/2009 00:19:07] stack traceback:
[26/08/2009 00:19:07] data/movements/scripts/tiles.lua:99: in function <data/movements/scripts/tiles.lua:10>
==============================
*Here's the script
*============================
function onStepIn(cid, item, pos)
local actionn = 5025
local stor = 666211
local getstor = getPlayerStorageValue(cid,stor)
local playerpos = getPlayerPosition(cid)
if item.actionid == actionn and getstor == -1 then
doPlayerSendTextMessage(cid,22,"Has Roto el Sello de Apocalipsis.")
doTransformItem(item.uid, item.itemid - 1)
doSendMagicEffect(playerpos, 13)
setPlayerStorageValue(cid,stor,1)
else
doSendMagicEffect(playerpos, 13)
doPlayerSendTextMessage(cid,22,"Ya has roto este Sello.")
end
return TRUE
end
================================
*and here's the file "tiles.lua"

PHP:
local config = {
	maxLevel = getConfigInfo('maximumDoorLevel')
}

local increasingItems = {[416] = 417, [426] = 425, [446] = 447, [3216] = 3217, [3202] = 3215}
local decreasingItems = {[417] = 416, [425] = 426, [447] = 446, [3217] = 3216, [3215] = 3202}
local depots = {2589, 2590, 2591, 2592}

local checkCreature = {isPlayer, isMonster, isNpc}
function onStepIn(cid, item, position, fromPosition)
	if(not increasingItems[item.itemid]) then
		return FALSE
	end

	if(isPlayer(cid) ~= TRUE or isPlayerGhost(cid) ~= TRUE) then
		doTransformItem(item.uid, increasingItems[item.itemid])
	end

	if(item.actionid >= 194 and item.actionid <= 196) then
		local f = checkCreature[item.actionid - 193]
		if(f(cid) == TRUE) then
			doTeleportThing(cid, fromPosition, FALSE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
		end

		return TRUE
	end

	if(item.actionid >= 191 and item.actionid <= 193) then
		local f = checkCreature[item.actionid - 190]
		if(f(cid) ~= TRUE) then
			doTeleportThing(cid, fromPosition, FALSE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
		end

		return TRUE
	end

	if(isPlayer(cid) ~= TRUE) then
		return TRUE
	end

	if(item.actionid == 189 and isPremium(cid) ~= TRUE) then
		doTeleportThing(cid, fromPosition, FALSE)
		doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
		return TRUE
	end

	local gender = item.actionid - 186
	if(isInArray({PLAYERSEX_FEMALE,  PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender) == TRUE) then
		local playerGender = getPlayerSex(cid)
		if(playerGender ~= gender) then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
			doTeleportThing(cid, fromPosition, FALSE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
		end

		return TRUE
	end

	local skull = item.actionid - 180
	if(skull >= 0 and skull < 6) then
		local playerSkull = getCreatureSkullType(cid)
		if(playerSkull ~= skull) then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
			doTeleportThing(cid, fromPosition, FALSE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
		end

		return TRUE
	end

	local group = item.actionid - 150
	if(group >= 0 and group < 30) then
		local playerGroup = getPlayerGroupId(cid)
		if(playerGroup < group) then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
			doTeleportThing(cid, fromPosition, FALSE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
		end

		return TRUE
	end

	local vocation = item.actionid - 100
	if(vocation >= 0 and vocation < 50) then
		local playerVocationInfo = getVocationInfo(getPlayerVocation(cid))
		if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
			doTeleportThing(cid, fromPosition, FALSE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
		end

		return TRUE
	end

	if(item.actionid >= 1000 and item.actionid <= config.maxLevel) then
		if(getPlayerLevel(cid) < item.actionid - 1000) then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
			doTeleportThing(cid, fromPosition, FALSE)
			doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)
		end

		return TRUE
	end

	if(item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) <= 0) then
		doTeleportThing(cid, fromPosition, FALSE)
		doSendMagicEffect(position, CONST_ME_MAGIC_BLUE)

		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The tile seems to be protected against unwanted intruders.")
		return TRUE
	end

	if(getTileInfo(position).protection) then
		local depotPos, depot = getPlayerLookPos(cid), {}
		depotPos.stackpos = STACKPOS_GROUND
		while(true) do
			depotPos.stackpos = depotPos.stackpos + 1
			depot = getThingFromPos(depotPos)
			if(depot.uid == 0) then
				break
			end

			if(isInArray(depots, depot.itemid) == TRUE) then
				local depotItems = getPlayerDepotItems(cid, getDepotId(depot.uid))
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s" or "") .. ".")
				break
			end
		end

		return TRUE
	end

	return FALSE
end

function onStepOut(cid, item, position, fromPosition)
	if(not decreasingItems[item.itemid]) then
		return FALSE
	end

	if(isPlayer(cid) ~= TRUE or isPlayerGhost(cid) ~= TRUE) then
		doTransformItem(item.uid, decreasingItems[item.itemid])
		return TRUE
	end

	return FALSE
end

Someone could help me?

;)
 
Back
Top