Ae. Deu vontade de ajudar vocês(Mesmo que a maioria é um bando de folgados):
Paint(Testado em 1.4_d):
Npc:
<?xml version="1.0" encoding="UTF-8"?> <npc name="Deka" script="paint.lua" walkinterval="0" floorchange="0"> <health now="100" max="100"/> <look type="513" head="116" body="54" legs="114" feet="0" addons="2"/> <parameters> </parameters> </npc>
Scripts:
Salve como paint.lua
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} 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 npcHandler:setCallback(CALLBACK_GREET, greetCallback) npcHandler:setMessage(MESSAGE_GREET, 'Welcome to my painting shop |PLAYERNAME|!') function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local pokesalive = {} if(msgcontains(msg, 'paint')) then selfSay('Do you want to paint your pokemon\'s ball?', cid) talkState = 1 elseif(msgcontains(msg, 'yes') and talkState == 1) then selfSay('Nice, you can choose: Pokeball, Greatball, Superball and Ultraball.', cid) talkState = 2 elseif(msgcontains(msg, 'no') and talkState == 1) then selfSay('So, whenever you want it, just came here and ask for!', cid) talkState = 0 npcHandler:releaseFocus(cid) elseif((msgcontains(msg, 'pokeball') or msgcontains(msg, 'poke ball') or msgcontains(msg, 'Pokeball') or msgcontains(msg, 'Poke ball')) and talkState == 2) then if isInArray(pokesalive, getPlayerSlotItem(cid,8).itemid) then selfSay('Do you really want to paint your ball like a Pokeball? It will cost you 50 dollars!', cid) talkState = 3 else selfSay('You must put the ball closed at the ball slot first.', cid) talkState = 0 end elseif(msgcontains(msg, 'yes') and talkState == 3) then if isInArray(pokesalive, getPlayerSlotItem(cid,8).itemid) then if doPlayerRemoveMoney(cid,5000) == true then selfSay('Nice choose, from now one, it will look like a Pokeball! There are anything else that I can help you with?', cid) doTransformItem(getPlayerSlotItem(cid, 8).uid, ) talkState = 0 else selfSay('Sorry '.. getCreatureName(cid) ..', but you don\'t have enough money.', cid) talkState = 0 end else selfSay('Please keep your ball closed at the ball slot.', cid) talkState = 0 end elseif((msgcontains(msg, 'greatball') or msgcontains(msg, 'great ball') or msgcontains(msg, 'Greatball') or msgcontains(msg, 'Great ball')) and talkState == 2) then if isInArray(pokesalive, getPlayerSlotItem(cid,8).itemid) then selfSay('Do you really want to paint your ball like a Greatball? It will cost you 50 dollars!', cid) talkState = 4 else selfSay('You must put the ball closed at the balls slot first.', cid) talkState = 0 end elseif(msgcontains(msg, 'yes') and talkState == 4) then if isInArray(pokesalive, getPlayerSlotItem(cid,8).itemid) then if doPlayerRemoveMoney(cid,5000) == true then selfSay('Nice choose, from now one, it will look like a Greatball! There are anything else that I can help you with?', cid) doTransformItem(getPlayerSlotItem(cid, 8).uid, ) talkState = 0 else selfSay('Sorry '.. getCreatureName(cid) ..', but you don\'t have enough money.', cid) talkState = 0 end else selfSay('Please keep your ball closed at the ball slot.', cid) talkState = 0 end elseif((msgcontains(msg, 'superball') or msgcontains(msg, 'super ball') or msgcontains(msg, 'Superball') or msgcontains(msg, 'Super ball')) and talkState == 2) then if isInArray(pokesalive, getPlayerSlotItem(cid,8).itemid) then selfSay('Do you really want to paint your ball like a Superball? It will cost you 50 dollars!', cid) talkState = 5 else selfSay('You must put the ball closed at the ball slot first.', cid) talkState = 0 end elseif(msgcontains(msg, 'yes') and talkState == 5) then if isInArray(pokesalive, getPlayerSlotItem(cid,8).itemid) then if doPlayerRemoveMoney(cid,5000) == true then selfSay('Nice choose, from now one, it will look like a Superball! There are anything else that I can help you with?', cid) doTransformItem(getPlayerSlotItem(cid, 8).uid, ) talkState = 0 else selfSay('Sorry '.. getCreatureName(cid) ..', but you don\'t have enough money.', cid) talkState = 0 end else selfSay('Please keep your ball closed at the ball slot.', cid) talkState = 0 end elseif((msgcontains(msg, 'ultraball') or msgcontains(msg, 'ultra ball') or msgcontains(msg, 'Ultraball') or msgcontains(msg, 'Ultra ball')) and talkState == 2) then if isInArray(pokesalive, getPlayerSlotItem(cid,8).itemid) then selfSay('Do you really want to paint your ball like a Ultraball? It will cost you 50 dollars!', cid) talkState = 6 else selfSay('You must put the ball closed at the ball slot first.', cid) talkState = 0 end elseif(msgcontains(msg, 'yes') and talkState == 6) then if isInArray(pokesalive, getPlayerSlotItem(cid,8).itemid) then if doPlayerRemoveMoney(cid,5000) == true then selfSay('Nice choose, from now one, it will look like a Ultraball! There are anything else that I can help you with?', cid) doTransformItem(getPlayerSlotItem(cid, 8).uid, ) talkState = 0 else selfSay('Sorry '.. getCreatureName(cid) ..', but you don\'t have enough money.', cid) talkState = 0 end else selfSay('Please keep your ball closed at the ball slot.', cid) talkState = 0 end end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Agora é so configurar. =D
E sim eu tirei a config de propósito.
Alguem configura Pra versão E???
aqui não funciona.. fda este problema
ai eu apago oq ele epde da outro na 61.. Valews aew
INFO: Starting OTScript Debug.lua
ERROR: paint.lua:38: unexpected symbol near ')'
INFO: Stopping OTScript Debug.lua






info
Grupo: Conde
Registrado: 06/08/11
Posts: 752
Reputação: +112
Não sei se ja postaram isso, mas ja sei faz tempo
Enquanto ta no evoluindo se falar !cd da erro console, mas é simples só colocar uma condição se o nome for evolution return true certo? bem ta ai uma coisa para deixar um serve com menos bugs, qualquer coisa to aceitando pm