Postado Junho 18, 2015 10 anos Ola, estou com problemas com o TFS 1.2 gostaria de saber de saber se alguém tem algum npc que adicione storage 20 no player que pedir missão, ou algum baú item com função semelhante. desde já agradeço
Postado Junho 18, 2015 10 anos é só adc essa linha no código: player:setStorageValue(20, 1) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Junho 18, 2015 10 anos use essa aqui de modelo. script.lua 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) -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself. if (not npcHandler:isFocused(cid)) then return false end if msgcontains(msg, 'PALAVRA AQUI') and getPlayerStorageValue(cid, 60100) == -1 then npcHandler:say('You dont want to know {what} is happening down there. I warn you!', cid) talk_state = 5 elseif msgcontains(msg, 'what') and talk_state == 5 then npcHandler:say('Sobkowiak was a teacher a long long time ago. She was always hard on her students. The ones who survived her class were never the same. If you are brave enough, I can let you {pass}.', cid) talk_state = 6 elseif msgcontains(msg, 'PALAVRA AQUI) and talk_state == 6 then npcHandler:say('Are sure You wanna go there?', cid) talk_state = 7 elseif msgcontains(msg, 'yes') and talk_state == 7 then npcHandler:say('As You wish. Good luck, You are really going to need it!', cid) setPlayerStorageValue(cid,60100, 1) talk_state = 0 elseif msgcontains(msg, 'no') and talk_state == 7 then npcHandler:say('Smart choice.', cid) talk_state = 0 ------------------------------------------------ confirm no ------------------------------------------------ -- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself. return true end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) npc/npc.xml <?xml version="1.0" encoding="UTF-8"?> <npc name="Albert" script="albert.lua" walkinterval="2000" floorchange="0"> <health now="150" max="150"/> <look type="146" head="116" body="113" legs="114" feet="98" addons="2"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|. You are standing next to {PALAVRA AQUI}. Be quiet, she can hear everything!"/> </parameters> </npc>
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.