• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Npc

pele112

Member
Joined
Aug 9, 2007
Messages
572
Reaction score
8
Location
Wodzisław Śląski
Dobry! :P Mam taki problem a właściwie proźbe ;]
Czy mógłby mi ktoś zrobić npc u którego można przepłynąć statkiem jak się mu da dane itemki.
Wystarczy, że sie mu da tylko raz itemki a można przepływać cały czas.
Za pomoc bd kwadracik haha:p
 
hmm nie sprawdzałem zrobiłem na szybca...
Code:
local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        
        -- OTServ event handling functions start
        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
        -- OTServ event handling functions end
function creatureSayCallback(cid, type, msg)
	if(getPlayerStorageValue(cid, 1337,1) then
		    local travelNode = keywordHandler:addKeyword({'idz'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'czy chcesz isc?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 0, destination = {x=100, y=200, z=7} })
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'To spierdalaj!'})
        else
		if(not npcHandler:isFocused(cid)) then
			return FALSE
		end
		
		npcHandler.talkStart[cid] = os.time()
		msg = string.lower(msg) 
		if msgcontains(msg, 'item') then
			npcHandler:say('Dajesz to kurwa ?', cid)
			talk_state[talkUser] = 1
		elseif msgcontains(msg, 'yes') then
			if talk_state[talkUser] == 1 then
		if doPlayerRemoveMoney(cid,2391249) == TRUE then
			setPlayerStorageValue(cid, 1337, 1)
			npcHandler:say('Danke i spierdalaj.', cid)
		else
			npcHandler:say('nie masz kaski wiec spierdalaj', cid)
		end
		end
	end
end

        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Mam nasrane w pale dej mi item'})
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
Może czegoś brakować nie sprawdzałem tego ale powinieneś obczaić ocb
 
Last edited:
Back
Top