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

Lua Problem with script, little error! ^^ [3x repp++ if someone can fix it]

picachu

Member
Joined
Dec 2, 2007
Messages
970
Reaction score
11
I get this error on console:

[18/01/2010 21:46:11] [Error - MoveEvents Interface]
[18/01/2010 21:46:11] data/movements/scripts/area.lua:eek:nStepIn
[18/01/2010 21:46:11] Description:
[18/01/2010 21:46:11] data/movements/scripts/area.lua:4: attempt to compare number with boolean
[18/01/2010 21:46:11] stack traceback:
[18/01/2010 21:46:11] data/movements/scripts/area.lua:4: in function <data/movements/scripts/area.lua:1>

And my lua script is:

Lua:
function onStepIn(cid, item, position, pos)
local pos = {x=3595,y=4527,z=7}

	doTeleportThing(cid, getPlayerItemCount(cid, 2210) > 0 and {x = position.x, y = position.y, z = position.z} or pos)
end

Help fast please.
 
Is this more like what you need?
I'm guessing you want it when a player walks across a tile it Tp's them.. I think. Describe what you need and I'll be better able to help you,.

Code:
function onStepIn(cid, item, position, pos)
local pos = {x = 3595, y = 4527, z = 7}

if getPlayerItemCount(cid, 2210) > 0 then
	doTeleportThing(cid, pos)
	return true
end
end
 
Last edited:
No.
I want when player walks in the tile, if he not have the item id '2210' he's teleported to 3595, 4527, 7.

:)
help plx
thx
 
just use that and change one line


Code:
function onStepIn(cid, item, position, pos)
local pos = {x = 3595, y = 4527, z = 7}

if getPlayerItemCount(cid, 2210) = 0 then
	doTeleportThing(cid, pos)
	return true
end
end
 
New error guy...

[19/01/2010 01:56:56] [Error - LuaScriptInterface::loadFile] data/movements/scripts/area.lua:4: 'then' expected near '='
[19/01/2010 01:56:56] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/area.lua)
[19/01/2010 01:56:56] data/movements/scripts/area.lua:4: 'then' expected near '='
 
maybe this will work. i don't see why it's saying expected then at =

Code:
function onStepIn(cid, item, position, pos)
local position = {x = 3595, y = 4527, z = 7}
local required = 2210

if getPlayerItemCount(cid, required) = 0 then
	doTeleportThing(cid, position)
	return true
end
end
 
[19/01/2010 12:04:23] [Error - LuaScriptInterface::loadFile] data/movements/scripts/xpringcorredor.lua:5: 'then' expected near '='
[19/01/2010 12:04:23] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/xpringcorredor.lua)
[19/01/2010 12:04:23] data/movements/scripts/xpringcorredor.lua:5: 'then' expected near '='

using TFS 0.3.6
 
Code:
function onStepIn(cid, item, position, fromPosition)
	return getPlayerItemCount(cid, 2210) > 0 and doTeleportThing(cid, {x = 3595, y = 4527, z = 7})
end
 
Another error
:S
Cykotitan, i want that:
if the player pass on tile and he HAVE item 2210, he can pass ok..
but, if he pass on the tile whitout item id 2210 , he's teleported to the coords.
i think i'll understend..


[19/01/2010 13:11:00] [Error - MoveEvents Interface]
[19/01/2010 13:11:00] data/movements/scripts/area.lua:eek:nStepIn
[19/01/2010 13:11:00] Description:
[19/01/2010 13:11:00] (luaGetPlayerItemCount) Player not found

[19/01/2010 13:11:00] [Error - MoveEvents Interface]
[19/01/2010 13:11:00] data/movements/scripts/area.lua:eek:nStepIn
[19/01/2010 13:11:00] Description:
[19/01/2010 13:11:00] data/movements/scripts/area.lua:2: attempt to compare number with boolean
[19/01/2010 13:11:00] stack traceback:
[19/01/2010 13:11:00] data/movements/scripts/area.lua:2: in function <data/movements/scripts/area.lua:1>
 
Code:
function onStepIn(cid, item, position, pos)
local position = {x = 3595, y = 4527, z = 7}
local required = 2210

if getPlayerItemCount(cid, required) = [COLOR="Red"]"0"[/COLOR]then
	doTeleportThing(cid, position)
	return true
end
end
add the red :p
 
Sexy Vampire, your script i getting error too :S

[19/01/2010 13:14:33] [Error - LuaScriptInterface::loadFile] data/movements/scripts/area.lua:5: 'then' expected near '='
[19/01/2010 13:14:33] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/area.lua)
[19/01/2010 13:14:33] data/movements/scripts/area.lua:5: 'then' expected near '='
 
Code:
function onStepIn(cid, item, position, fromPosition)
	local getN = getPlayerItemCount(cid, 2210)
	if getN and getN > 0 then
		doTeleportThing(cid, {x = 3595, y = 4527, z = 7})
	end
end
 
It's teleporting players who have item '2210' :|
but if i DON'T HAVE the item 2210, it don't teleport ;(

i need it if he DON'T HAVE, he teleported.
if he HAVE, don't do nothing. :)
 
Code:
function onStepIn(cid, item, position, fromPosition)
	local getN = getPlayerItemCount(cid, 2210)
	if getN and getN [COLOR="Red"][B]< 1[/B][/COLOR] then
		doTeleportThing(cid, {x = 3595, y = 4527, z = 7})
	end
end
Is it hard to change > to < and 0 to 1 instead of waiting for me to stumble upon this thread again?
 
Back
Top