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

Felipe Monteiro

Webmaster
Joined
Feb 27, 2009
Messages
460
Reaction score
59
Location
Brasil
Well i'm working in a npc that send u to any place, only if u had any storage.

To send player to any place i know, idk to get storage...
Sorry by my english

I hope someone can help me!
Thanx anyway!
 
LUA:
if getPlayerStorageValue(cid, 1000) == 1 then
	doTeleportThing(cid, {x=1000,y=1000,z=7})
else
	doPlayerSendTextMessage(cid, 22, "You need storage in order to teleport.")
end
 
No, i'm looking for a npc that send player to position that i set, but tha only will send if player had any storage.

- - - Updated - - -

LUA:
if getPlayerStorageValue(cid, 1000) == 1 then
	doTeleportThing(cid, {x=1000,y=1000,z=7})
else
	doPlayerSendTextMessage(cid, 22, "You need storage in order to teleport.")
end

I'll try it !

- - - Updated - - -

not work. i think it doesnt work becaus i dont know to configure script.
If anyone give me an example, i think i'll can to configure.

- - - Updated - - -

i'll show how i'm doing..

this is my script to sendo player, its like npc travel..

LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid) 			end
function onCreatureDisappear(cid) 			npcHandler:onCreatureDisappear(cid) 		end
function onCreatureSay(cid, type, msg) 		npcHandler:onCreatureSay(cid, type, msg) 	end
function onThink() 							npcHandler:onThink() 						end
function onPlayerEndTrade(cid)				npcHandler:onPlayerEndTrade(cid)			end
function onPlayerCloseChannel(cid)			npcHandler:onPlayerCloseChannel(cid)		end
        
        
        local travelNode = keywordHandler:addKeyword({'rookgaard'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Are you prepared to your destiny?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=32097, y=32219, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
			
		local travelNode = keywordHandler:addKeyword({'rook'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Are you prepared to your destiny?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=32097, y=32219, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
			
		local travelNode = keywordHandler:addKeyword({'rookgard'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Are you prepared to your destiny?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=32097, y=32219, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'We would like to serve you some time.'})
      
	  npcHandler:addModule(FocusModule:new())

But i'd like that npc onlu send if get any storage of player.. idk to do this
 

Similar threads

Back
Top