• 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 NPC Script

corolho

New Member
Joined
Aug 7, 2013
Messages
10
Reaction score
0
Hello, I'm trying make a script but i dont know how to do that.

Lua:
local items = {
[1745] = {price= 500 , name= "Mega Sword", tipo="boots" , quant = 1}
}

for k ,v in pairs(items) do
	elseif msgcontains(msg,'".. v.name .."') then
		npcHandler:say("Do you want a {".. v.name .."}?",cid)
		talkState[cid] = 1
 
Do you mean like this?
Lua:
local items = {
["mega sword"] = {price = 500 , id = 1754, tipo = "boots", quant = 1}
}

local x = items[msg:lower()]
if x then
	npcHandler:say("Do you want a {".. msg .."}?",cid)
	talkState[cid] = 1
	-- to get price, id, etc you can use x.price, x.id
 
Back
Top