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

Solved Depot issue and LUA Error [Screenshot]

xSable

New Member
Joined
May 9, 2013
Messages
36
Reaction score
4
Okay, so here is my issue. I start up the server, and it loads up and says this.

lua error 2.jpglua error 3.jpglua error.jpg


I don't know what is wrong with it, I'm just now learning everything. I searched, but I couldn't see anything to fix it. So far haven't seen any LUA tutorials that focus on the language. If I missed it, I'd appreciate a link. After these show up, it just keeps repeating the backtrace etc message. The server runs no problem, but with it doing this the whole time it's getting really aggravating.

That's my first issue. My second issue is that my depots don't work. If you put something in one, someone else can take the item out. It doesn't save on server reset or anything either. Basically treats it like a plain lockbox. No "depot box" inside it or anything. I think it may be more a mapping issue, but again I am still learning.

If anyone can help with either of these it would be very appreciated. :)
 
Last edited:
It says the error is coming from seller.lua, please provide all scripts where you may suspect an error is coming from.
 
Seller.lua code

It says on Seller.lua you have an extra end.

See, I don't know what that means. I just downloaded a distro a friend gave me the link to. This is the seller.lua in that location.

Code:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  		selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (20gp), backpacks (1k-gp),  fishing rods (100gp) , Bait and picks, propscheck, propsrune, bitchadd and bitchcheck for community reputation!! lumberjacking axes, Say lumberjack') 
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'helm') then
			buy(cid,2501,1,50)
		if msgcontains(msg, 'arm') then
			buy(cid,2653,1,50)
		if msgcontains(msg, 'legs') then
			buy(cid,2126,1,50)
		if msgcontains(msg, 'bots') then
			buy(cid,2649,1,50)
		if msgcontains(msg, 'ring') then
			buy(cid,2165,1,50)
		if msgcontains(msg, 'ammy') then
			buy(cid,2210,1,50)
		if msgcontains(msg, 'rope') then
			buy(cid,2120,1,50)
		elseif msgcontains(msg, 'shovel') then
			buy(cid,2554,1,20)
		elseif msgcontains(msg, 'backpack') then
			buy(cid,1988,1,1000)
		
		elseif msgcontains(msg, 'fishing rod') then
			buy(cid,2580,1,100)
		elseif msgcontains(msg, 'torch') then
			buy(cid,2050,1,2)
		
		elseif msgcontains(msg, 'goldup') then
			buy(cid,2152,1,100)
		elseif msgcontains(msg, 'platdown') then
			buy(cid,2148,100,100)
		elseif msgcontains(msg, 'platup') then
			buy(cid,2160,1,10000)
		elseif msgcontains(msg, 'crystaldown') then
			buy(cid,2152,100,10000)
		elseif msgcontains(msg, 'crystalup') then
			buy(cid,2320,1,1000000)
		elseif msgcontains(msg, 'skulldown') then
			buy(cid,2160,100,1000000)

		elseif msgcontains(msg, 'lumberjack') then
			buy(cid,2386,1,100000)

		elseif msgcontains(msg, 'umbrella') then
			buy(cid,2229,1,150)
		elseif msgcontains(msg, 'umbrella2') then
			buy(cid,2229,90,150)
		elseif msgcontains(msg, 'umbrella3') then
			buy(cid,2160,90,150)
		elseif msgcontains(msg, 'document') then
			buy(cid,2653,1,150)
		elseif msgcontains(msg, 'document1') then
			buy(cid,2649,1,150)
		elseif msgcontains(msg, 'document2') then
			buy(cid,2501,1,150)
		elseif msgcontains(msg, 'document3') then
			buy(cid,2165,1,150)
		elseif msgcontains(msg, 'document4') then
			buy(cid,2126,1,150)
		elseif msgcontains(msg, 'document5') then
			buy(cid,2207,1,150)

		elseif msgcontains(msg, 'yellowbackpack') then
			buy(cid,1999,1,1000)

		elseif msgcontains(msg, 'redbackpack') then
			buy(cid,2000,1,1000)

		elseif msgcontains(msg, 'purplebackpack') then
			buy(cid,2001,1,1000)


		elseif msgcontains(msg, 'bluebackpack') then
			buy(cid,2002,1,1000)


		elseif msgcontains(msg, 'greybackpack') then
			buy(cid,2003,1,1000)

		elseif msgcontains(msg, 'goldbackpack') then
			buy(cid,2004,1,1000)

		elseif msgcontains(msg, 'greenbackpack') then
			buy(cid,1998,1,1000)
		
	
		elseif msgcontains(msg, 'bait') then
			buy(cid,3976,100,1)

		elseif msgcontains(msg, 'pick') then
			buy(cid,2553,1,1000000)





		elseif msgcontains(msg, 'propsrune') then
			buy(cid,2290,1,500000)

		
            	 
		elseif msgcontains(msg, 'propscheck') then
			buy(cid,2291,1,100000)




		
		elseif msgcontains(msg, 'bitchadd') then
			buy(cid,2265,1,500000)

		
            	 
		elseif msgcontains(msg, 'bitchcheck') then
			buy(cid,2266,1,100000)



		 
		












		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end


And I don't know if it makes a difference, because I'm still just learning all of this, but it said something about line 56. Here is lines 50 - 60 of the code. (If that's what it means.)

Code:
	if msgcontains(msg, 'helm') then
			buy(cid,2501,1,50)
		if msgcontains(msg, 'arm') then
			buy(cid,2653,1,50)
		if msgcontains(msg, 'legs') then
			buy(cid,2126,1,50)
		if msgcontains(msg, 'bots') then
			buy(cid,2649,1,50)
		if msgcontains(msg, 'ring') then
			buy(cid,2165,1,50)
		if msgcontains(msg, 'ammy') then
 
Try this:
Lua:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end


function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  		selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (20gp), backpacks (1k-gp),  fishing rods (100gp) , Bait and picks, propscheck, propsrune, bitchadd and bitchcheck for community reputation!! lumberjacking axes, Say lumberjack') 
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'helm') then
			buy(cid,2501,1,50)
		end
		if msgcontains(msg, 'arm') then
			buy(cid,2653,1,50)
		end
		if msgcontains(msg, 'legs') then
			buy(cid,2126,1,50)
		end
		if msgcontains(msg, 'bots') then
			buy(cid,2649,1,50)
		end
		if msgcontains(msg, 'ring') then
			buy(cid,2165,1,50)
		end
		if msgcontains(msg, 'ammy') then
			buy(cid,2210,1,50)
		end
		if msgcontains(msg, 'rope') then
			buy(cid,2120,1,50)
		elseif msgcontains(msg, 'shovel') then
			buy(cid,2554,1,20)
		elseif msgcontains(msg, 'backpack') then
			buy(cid,1988,1,1000)
		elseif msgcontains(msg, 'fishing rod') then
			buy(cid,2580,1,100)
		elseif msgcontains(msg, 'torch') then
			buy(cid,2050,1,2)
		elseif msgcontains(msg, 'goldup') then
			buy(cid,2152,1,100)
		elseif msgcontains(msg, 'platdown') then
			buy(cid,2148,100,100)
		elseif msgcontains(msg, 'platup') then
			buy(cid,2160,1,10000)
		elseif msgcontains(msg, 'crystaldown') then
			buy(cid,2152,100,10000)
		elseif msgcontains(msg, 'crystalup') then
			buy(cid,2320,1,1000000)
		elseif msgcontains(msg, 'skulldown') then
			buy(cid,2160,100,1000000)
		elseif msgcontains(msg, 'lumberjack') then
			buy(cid,2386,1,100000)
		elseif msgcontains(msg, 'umbrella') then
			buy(cid,2229,1,150)
		elseif msgcontains(msg, 'umbrella2') then
			buy(cid,2229,90,150)
		elseif msgcontains(msg, 'umbrella3') then
			buy(cid,2160,90,150)
		elseif msgcontains(msg, 'document') then
			buy(cid,2653,1,150)
		elseif msgcontains(msg, 'document1') then
			buy(cid,2649,1,150)
		elseif msgcontains(msg, 'document2') then
			buy(cid,2501,1,150)
		elseif msgcontains(msg, 'document3') then
			buy(cid,2165,1,150)
		elseif msgcontains(msg, 'document4') then
			buy(cid,2126,1,150)
		elseif msgcontains(msg, 'document5') then
			buy(cid,2207,1,150)
		elseif msgcontains(msg, 'yellowbackpack') then
			buy(cid,1999,1,1000)
		elseif msgcontains(msg, 'redbackpack') then
			buy(cid,2000,1,1000)
		elseif msgcontains(msg, 'purplebackpack') then
			buy(cid,2001,1,1000)
		elseif msgcontains(msg, 'bluebackpack') then
			buy(cid,2002,1,1000)
		elseif msgcontains(msg, 'greybackpack') then
			buy(cid,2003,1,1000)
		elseif msgcontains(msg, 'goldbackpack') then
			buy(cid,2004,1,1000)
		elseif msgcontains(msg, 'greenbackpack') then
			buy(cid,1998,1,1000)
		elseif msgcontains(msg, 'bait') then
			buy(cid,3976,100,1)
		elseif msgcontains(msg, 'pick') then
			buy(cid,2553,1,1000000)
		elseif msgcontains(msg, 'propsrune') then
			buy(cid,2290,1,500000)	 
		elseif msgcontains(msg, 'propscheck') then
			buy(cid,2291,1,100000)
		elseif msgcontains(msg, 'bitchadd') then
			buy(cid,2265,1,500000) 
		elseif msgcontains(msg, 'bitchcheck') then
			buy(cid,2266,1,100000)
		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	end
end

function onCreatureChangeOutfit(creature)
end

function onThink()
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end
 
Try this:
Lua:
focus = 0
talk_start = 0
target = 0
following = false
attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)
end


function onCreatureAppear(creature)
end

function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end

function onCreatureTurn(creature)
end

function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end

function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  		selfSay('Hello, ' .. creatureGetName(cid) .. '! I sell ropes (50gp), shovels (20gp), backpacks (1k-gp),  fishing rods (100gp) , Bait and picks, propscheck, propsrune, bitchadd and bitchcheck for community reputation!! lumberjacking axes, Say lumberjack') 
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'helm') then
			buy(cid,2501,1,50)
		end
		if msgcontains(msg, 'arm') then
			buy(cid,2653,1,50)
		end
		if msgcontains(msg, 'legs') then
			buy(cid,2126,1,50)
		end
		if msgcontains(msg, 'bots') then
			buy(cid,2649,1,50)
		end
		if msgcontains(msg, 'ring') then
			buy(cid,2165,1,50)
		end
		if msgcontains(msg, 'ammy') then
			buy(cid,2210,1,50)
		end
		if msgcontains(msg, 'rope') then
			buy(cid,2120,1,50)
		elseif msgcontains(msg, 'shovel') then
			buy(cid,2554,1,20)
		elseif msgcontains(msg, 'backpack') then
			buy(cid,1988,1,1000)
		elseif msgcontains(msg, 'fishing rod') then
			buy(cid,2580,1,100)
		elseif msgcontains(msg, 'torch') then
			buy(cid,2050,1,2)
		elseif msgcontains(msg, 'goldup') then
			buy(cid,2152,1,100)
		elseif msgcontains(msg, 'platdown') then
			buy(cid,2148,100,100)
		elseif msgcontains(msg, 'platup') then
			buy(cid,2160,1,10000)
		elseif msgcontains(msg, 'crystaldown') then
			buy(cid,2152,100,10000)
		elseif msgcontains(msg, 'crystalup') then
			buy(cid,2320,1,1000000)
		elseif msgcontains(msg, 'skulldown') then
			buy(cid,2160,100,1000000)
		elseif msgcontains(msg, 'lumberjack') then
			buy(cid,2386,1,100000)
		elseif msgcontains(msg, 'umbrella') then
			buy(cid,2229,1,150)
		elseif msgcontains(msg, 'umbrella2') then
			buy(cid,2229,90,150)
		elseif msgcontains(msg, 'umbrella3') then
			buy(cid,2160,90,150)
		elseif msgcontains(msg, 'document') then
			buy(cid,2653,1,150)
		elseif msgcontains(msg, 'document1') then
			buy(cid,2649,1,150)
		elseif msgcontains(msg, 'document2') then
			buy(cid,2501,1,150)
		elseif msgcontains(msg, 'document3') then
			buy(cid,2165,1,150)
		elseif msgcontains(msg, 'document4') then
			buy(cid,2126,1,150)
		elseif msgcontains(msg, 'document5') then
			buy(cid,2207,1,150)
		elseif msgcontains(msg, 'yellowbackpack') then
			buy(cid,1999,1,1000)
		elseif msgcontains(msg, 'redbackpack') then
			buy(cid,2000,1,1000)
		elseif msgcontains(msg, 'purplebackpack') then
			buy(cid,2001,1,1000)
		elseif msgcontains(msg, 'bluebackpack') then
			buy(cid,2002,1,1000)
		elseif msgcontains(msg, 'greybackpack') then
			buy(cid,2003,1,1000)
		elseif msgcontains(msg, 'goldbackpack') then
			buy(cid,2004,1,1000)
		elseif msgcontains(msg, 'greenbackpack') then
			buy(cid,1998,1,1000)
		elseif msgcontains(msg, 'bait') then
			buy(cid,3976,100,1)
		elseif msgcontains(msg, 'pick') then
			buy(cid,2553,1,1000000)
		elseif msgcontains(msg, 'propsrune') then
			buy(cid,2290,1,500000)	 
		elseif msgcontains(msg, 'propscheck') then
			buy(cid,2291,1,100000)
		elseif msgcontains(msg, 'bitchadd') then
			buy(cid,2265,1,500000) 
		elseif msgcontains(msg, 'bitchcheck') then
			buy(cid,2266,1,100000)
		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	end
end

function onCreatureChangeOutfit(creature)
end

function onThink()
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end

Definitely fixed it! +Rep
Mind explaining what you did? I'd like to learn how to fix these issues. XD
 
For every if, you need an end.
You do not need ends for elseifs, but elseifs must be between an if and an end.

CORRECT:
Lua:
if blabla then
-- do something
end
if blabla2 then
-- do something
end
INCORRECT:
Lua:
if blabla then
-- do something
if blabla2 then
-- do something
end

CORRECT:
Lua:
if blabla then
-- do something
elseif blabla2 then
-- do something
elseif blabla3 then
-- do something
elseif blabla4 then
-- do something
end
INCORRECT:
Lua:
if blabla then
-- do something
end
elseif blabla2 then
-- do something
end
elseif blabla3 then
-- do something
end
elseif blabla4 then
-- do something
end
 
For every if, you need an end.
You do not need ends for elseifs, but elseifs must be between an if and an end.

CORRECT:
Lua:
if blabla then
-- do something
end
if blabla2 then
-- do something
end
INCORRECT:
Lua:
if blabla then
-- do something
if blabla2 then
-- do something
end

CORRECT:
Lua:
if blabla then
-- do something
elseif blabla2 then
-- do something
elseif blabla3 then
-- do something
elseif blabla4 then
-- do something
end
INCORRECT:
Lua:
if blabla then
-- do something
end
elseif blabla2 then
-- do something
end
elseif blabla3 then
-- do something
end
elseif blabla4 then
-- do something
end

Ah! Okay. I compared the old one to yours. Thanks. Learning experience. >:D
 
Back
Top