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

Lua Weird error

Santi

Theres no way im stopping
Joined
Aug 29, 2010
Messages
1,975
Reaction score
152
Location
00
So, the script is supposed to, when the player steps, summon 2 creatures, from player positions to x+1 or y-1/y+1 depending.
But Im getting a weird error, and I can't understand why.
LUA:
local t = {
[5000] = {{x = getPlayerPosition(cid).x-1, y = getPlayerPosition(cid).y+1, z = getPlayerPosition(cid).z},{x = getPlayerPosition(cid).x-1, y = getPlayerPosition(cid).y-1, z = getPlayerPosition(cid).z}},
[5001] = {{x = getPlayerPosition(cid).x+1, y = getPlayerPosition(cid).y+1, z = getPlayerPosition(cid).z},{x = getPlayerPosition(cid).x+1, y = getPlayerPosition(cid).y-1, z = getPlayerPosition(cid).z}}
}

function OnStepIn(cid, item, pos)
local v = t[item.uid]
if v then
   doSummonCreature("demon",v[1])
   doSummonCreature("demon",v[2])
	end
   return true
end

Error:
Code:
[01/12/2010 15:37:17] [Error - MoveEvents Interface] 
[01/12/2010 15:37:17] data/movements/scripts/Training System.lua
[01/12/2010 15:37:17] Description: 
[01/12/2010 15:37:17] data/movements/scripts/Training System.lua:2: attempt to index a boolean value
[01/12/2010 15:37:17] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/Training System.lua)

Rep for whoever helps ;)
 
I help lots, and I'm being honest. This training monk system has been released, people just have to use search.php more often. <,<


EDIT: And FYI, 'Posts Per Day 3.47'

<,<
 
change to

LUA:
function OnStepIn(cid, item, pos)
local t = {
[5000] = {{x = getPlayerPosition(cid).x-1, y = getPlayerPosition(cid).y+1, z = getPlayerPosition(cid).z},{x = getPlayerPosition(cid).x-1, y = getPlayerPosition(cid).y-1, z = getPlayerPosition(cid).z}},
[5001] = {{x = getPlayerPosition(cid).x+1, y = getPlayerPosition(cid).y+1, z = getPlayerPosition(cid).z},{x = getPlayerPosition(cid).x+1, y = getPlayerPosition(cid).y-1, z = getPlayerPosition(cid).z}}
}
local v = t[item.uid]
if v then
   doSummonCreature("demon",v[1])
   doSummonCreature("demon",v[2])
	end
   return true
end
 
l2shorten
LUA:
function onStepIn(cid, item, pos, fromPos)
	local t = {
		[5000]={{x=pos.x-1, y=pos.y+1, z=pos.z},{x=pos.x-1, y=pos.y-1, z=pos.z}},
		[5001]={{x=pos.x+1, y=pos.y+1, z=pos.z},{x=pos.x+1, y=pos.y-1, z=pos.z}}
	}
	local v = t[item.uid]
	if v then
		doSummonCreature('demon', v[1])
		doSummonCreature('demon', v[2])
	end
end
 
Back
Top