Postado Maio 9, 2015 10 anos Deu esse erro: Unexpected symbol near Teste novamente, errei uma variável. ➥ Regras | Seções OTServ | Seções BOT
Postado Maio 9, 2015 10 anos Autor Copiei novamente e está dando outro erro:'then' expected near '=' Agora é outro erro: 'then' expected near '='
Postado Maio 9, 2015 10 anos 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 function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local msg, price = string.lower(msg), 200000 local ticked_stor, max_stor = 23844, 788978 if isInArray({'bilhete', 'ticket', 'tickets'}, msg) then npcHandler:say('Você quer comprar um ticket por '..price..' gps? {yes}', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getGlobalStorageValue(max_stor) < 20 then if getPlayerStorageValue(cid, ticked_stor) <= 0 then if doPlayerRemoveMoney(cid, price) then setPlayerStorageValue(cid, ticked_stor, 1) setGlobalStorageValue(max_stor,getGlobalStorageValue(max_stor) < 0 and 1 or getGlobalStorageValue(max_stor)+1) npcHandler:say('aqui está seu bilhete.', cid) else npcHandler:say('you do not have enough money!', cid) talkState[talkUser] = 0 end else npcHandler:say('you already have ticket!', cid) talkState[talkUser] = 0 end else npcHandler:say('ticket esgotado!', cid) talkState[talkUser] = 0 end elseif msg == "no" then selfSay("Then not", cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Maio 9, 2015 10 anos Autor Essa pegou, só que eu quero 2 tickets no npc, 1 pra cada time. E por favor, poderia adicionar as storages no lugar certo? 34789 - 34790 cada time com a sua. Editado Maio 9, 2015 10 anos por arthur122222 (veja o histórico de edições)
Postado Maio 9, 2015 10 anos hmm entendi agr, o time blue e o time green, é isso? mas é 20 tickets(total 40) para cada time ou 10 tickets para cada time(total 20)? [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.