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

NPC that allows you to trade after when you get a storage.

Oskar1121

Excellent OT User
Joined
Jul 15, 2009
Messages
708
Reaction score
712
Location
Poland
Anybody know how can I make NPC almost this:
Player (witchout storage): Hi
NPC: Hello Player.
Player (witchout storage): Trade
NPC: You can't trade with me.

Player (witch storage): Trade
NPC: Here is my offer.

#edit
Ok, I did it myself.
Please about close this thread.
 
Last edited:
go to npc ---> lib --> modules --> search for
Code:
function ShopModule.requestTrade(cid, message, keywords, parameters, node)
and under
LUA:
local module = parameters.module
		if(not module.npcHandler:isFocused(cid)) then
			return false
		end
paste this
LUA:
			--[[ Checking for Storage]]--
		local storage = 1233   -- storage here
		local npc = {"alice","john","karim"}   -- names of npc's that will have this enabled


		for i = 1,#npc do
			if string.lower(getCreatureName(getNpcId())) == string.lower(npc[i]) then
				check = true
				break
			end
		end
		if check == true then
			if getPlayerStorageValue(cid,storage) < 1 then
				selfSay("you can't trade with me.",cid)
				return false
			end
		end
		--[[ End ]]--
 
oh i was going to do something else but i like the way you did it better thanks ill rep you after i get it working
 
Back
Top