Xtibianos, preciso da ajuda de vocês.
Estou com o script de pintar balls do Deathangels(OTIMO), estava configurando ele pra pintar as outras balls, só que fui editando, editando e editando e acabou bugando...
Acho que faltou algum "end" ou sobrou '-'
Vo postar o script modificado para vocês me ajudarem, pois ja tentei revisar e não conseguir.
Segue o script:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local states = {'1', '2', '3', '4', '5', '6'}
local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151}
local unlock = {}
local pokeballs = {'2222', '2208'}
local pokeballss = {'2220', '2208'}
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
-- Conversa Jogador/NPC
if(msgcontains(msg, 'Job') or msgcontains(msg, 'job')) then
selfSay('I paint Pokeball, choice between {Ultra ball}, {Poke ball}, {Dark ball}, {Love ball} and {Golden Ball}.', cid)
elseif(msgcontains(msg, 'Ultra Ball') or msgcontains(msg, 'ultra ball')) then
selfSay('Do you really want to paint ultra ball??', cid)
talkState[talkUser] = 1
elseif(msgcontains(msg, 'Poke Ball') or msgcontains(msg, 'poke ball')) then
selfSay('Do you really want to paint poke ball??', cid)
talkState[talkUser] = 2
elseif(msgcontains(msg, 'Dark ball') or msgcontains(msg, 'dark ball')) then
selfSay('Do you really want to paint dark ball??', cid)
talkState[talkUser] = 3
elseif(msgcontains(msg, 'Love ball') or msgcontains(msg, 'love ball')) then
selfSay('Do you really want to paint love ball??', cid)
talkState[talkUser] = 4
elseif(msgcontains(msg, 'Golden ball') or msgcontains(msg, 'golden ball')) then
selfSay('Do you really want to paint golden ball??', cid)
talkState[talkUser] = 5
-- Confirmação da Compra
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) and doPlayerRemoveMoney(cid, 35000) then
selfSay('Thanks!', cid)
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, 2220)
talkState[talkUser] = 0
else
selfSay('Sorry, make sure you have enough money and if the the ball is in the correct slot.', cid)
talkState[talkUser] = 0
end
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 2) then
if isInArray(pokeballss, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) and doPlayerRemoveMoney(cid, 20000) then
selfSay('Thanks!', cid)
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, 2222)
talkState[talkUser] = 0
else
selfSay('Sorry, make sure you have enough money and if the the ball is in the correct slot.', cid)
talkState[talkUser] = 0
end
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 3) then
if isInArray(pokeballss, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) and doPlayerRemoveMoney(cid, 20000) then
selfSay('Thanks!', cid)
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, 2650)
talkState[talkUser] = 0
else
selfSay('Sorry, make sure you have enough money and if the the ball is in the correct slot.', cid)
talkState[talkUser] = 0
end
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 4) then
if isInArray(pokeballss, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) and doPlayerRemoveMoney(cid, 20000) then
selfSay('Thanks!', cid)
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, 2649)
talkState[talkUser] = 0
else
selfSay('Sorry, make sure you have enough money and if the the ball is in the correct slot.', cid)
talkState[talkUser] = 0
end
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 5) then
if isInArray(pokeballss, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) and doPlayerRemoveMoney(cid, 20000) then
selfSay('Thanks!', cid)
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, 2648)
talkState[talkUser] = 0
else
selfSay('Sorry, make sure you have enough money and if the the ball is in the correct slot.', cid)
talkState[talkUser] = 0
end
end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Bem, ta ai galera.
Quem puder ajuda.
Agradeço desde ja.
Mateuso.