Witam.
Mam skrypt na Malowanie Balli, ale nie wiem dlaczego nie działa. Malować maluje ale kiedy chcem wyciągnąć pokemona nie da się oto skrypty
Paint.xml:
Oraz paint.lua
Proszę o szybką pomoc.
Mam skrypt na Malowanie Balli, ale nie wiem dlaczego nie działa. Malować maluje ale kiedy chcem wyciągnąć pokemona nie da się oto skrypty
Paint.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Jack" walkinterval="35000000" script="paint.lua" floorchange="0" speed="90">
<health now="150" max="150"/>
<look type="158" head="91" body="102" legs="83" feet="0"/>
<parameters>
<parameter key="message_greet" value="Welcome, i can {pintar} Poke Balls."/>
<parameter key="message_farewell" value="Bye! Please check back often."/>
<parameter key="message_idletimeout" value="Next ..."/>
<parameter key="message_walkaway" value="Come back whenever you want!"/>
</parameters>
</npc>
Oraz paint.lua
Code:
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 pintar(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
if isInArray({2220;2222;2651;2653;2655;11624;11621;11627;11618}, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
if(doPlayerRemoveMoney(cid, parameters.price)) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, parameters.bola)
selfSay('Bola Pintada!')
else
selfSay('Vocę năo tem dinheiro suficiente!')
end
else
selfSay('Coloque a pokebola correta no slot!')
end
npcHandler:resetNpc()
return true
end
local frase = 'Deseja pintar sua pokebola para'
local node1 = keywordHandler:addKeyword({'paint'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Eu faço as sequintes pinturas:\n-> pokeball: 10$\n->great ball: 25$\n->super ball: 100$\n->ultra ball: 150$\n->saffari ball: 150$\n->golden ball, fresh ball, dark ball e love ball: 200$'})
local node11 = node1:addChildKeyword({'pokeball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' pokeball?'})
node11:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 2222})
node11:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
local node12 = node1:addChildKeyword({'great ball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' great ball?'})
node12:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 2651})
node12:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
local node13 = node1:addChildKeyword({'super ball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' super ball?'})
node13:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 2653})
node13:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
local node14 = node1:addChildKeyword({'ultra ball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' ultra ball?'})
node14:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 2220})
node14:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
local node15 = node1:addChildKeyword({'saffari ball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' saffari ball?'})
node15:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 2655})
node15:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
local node16 = node1:addChildKeyword({'golden ball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' golden ball?'})
node16:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 11624})
node16:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
local node17 = node1:addChildKeyword({'fresh ball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' fresh ball?'})
node17:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 11627})
node17:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
local node18 = node1:addChildKeyword({'dark ball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' dark ball?'})
node18:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 11618})
node18:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
local node19 = node1:addChildKeyword({'love ball'},StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = frase..' love ball?'})
node19:addChildKeyword({'yes'}, pintar, {price = 5000,bola = 11621})
node19:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true})
npcHandler:addModule(FocusModule:new())
Proszę o szybką pomoc.