Postado Fevereiro 3, 2017 8 anos alguém poderia colocar que so players Premium possam comprar a bless nesse npc local config = { -- [bless] = preços [5] = {"Blessing", 500000} } 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 for k, v in pairs(config) do if v[1]:lower():find(msg:lower()) then selfSay("You are sure?", cid) talkState[talkUser] = k end if msgcontains(msg:lower(), "yes") then if talkState[talkUser] == k then if not getPlayerBlessing(cid, k) then if doPlayerRemoveMoney(cid, v[2]) then doPlayerAddBlessing(cid, k) selfSay("You received the bless " .. v[1]:gsub("The ", "", 1) .. "!", cid) doSendMagicEffect(getThingPos(cid), 10) else selfSay("You no have money.", cid) end else selfSay("You have " .. v[1] .. ".", cid) end talkState[talkUser] = 0 end end end if msgcontains(msg:lower(), "no") and talkState[talkUser] >= 1 then selfSay("Bye!!", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) ex: You not have {premium account}!
Postado Fevereiro 4, 2017 8 anos local config = { -- [bless] = preços [5] = {"Blessing", 500000} } 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 for k, v in pairs(config) do if v[1]:lower():find(msg:lower()) then selfSay("You are sure?", cid) talkState[talkUser] = k end if msgcontains(msg:lower(), "yes") then if talkState[talkUser] == k then if getPlayerPremiumDays(cid) > 0 then if not getPlayerBlessing(cid, k) then if doPlayerRemoveMoney(cid, v[2]) then doPlayerAddBlessing(cid, k) selfSay("You received the bless " .. v[1]:gsub("The ", "", 1) .. "!", cid) doSendMagicEffect(getThingPos(cid), 10) else selfSay("You no have money.", cid) end else selfSay("You have " .. v[1] .. ".", cid) end else selfSay("You do not have premmium account.", cid) end talkState[talkUser] = 0 end end end if msgcontains(msg:lower(), "no") and talkState[talkUser] >= 1 then selfSay("Bye!!", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
Postado Fevereiro 13, 2017 8 anos Autor chequei o script porem os players Premium quando vão comprar a bless, falam que eles precisão ser Premium ele logo manda essa mensagem selfSay("You do not have premmium account.", cid) tinha que dizer só para quem não é premium alguém pode me ajudar ? local config = { -- [bless] = preços [5] = {"Blessing", 500000} } 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 for k, v in pairs(config) do if v[1]:lower():find(msg:lower()) then selfSay("You are sure?", cid) talkState[talkUser] = k end if msgcontains(msg:lower(), "yes") and isPremium(cid) then if talkState[talkUser] == k then if not getPlayerBlessing(cid, k) then if doPlayerRemoveMoney(cid, v[2]) then doPlayerAddBlessing(cid, k) selfSay("You received the bless " .. v[1]:gsub("The ", "", 1) .. "!", cid) doSendMagicEffect(getThingPos(cid), 10) else selfSay("You no have money.", cid) end else selfSay("You have " .. v[1] .. ".", cid) end talkState[talkUser] = 0 end else selfSay("You not have {Premium account}!", cid) end end if msgcontains(msg:lower(), "no") and talkState[talkUser] >= 1 then selfSay("Bye!!", cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) alguem ajuda ?
Postado Fevereiro 13, 2017 8 anos local config = { -- [bless] = preços [5] = {"Blessing", 500000} } 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 premium = true for k, v in pairs(config) do if v[1]:lower():find(msg:lower()) then selfSay("You are sure?", cid) talkState[talkUser] = k end if msgcontains(msg:lower(), "yes") then if talkState[talkUser] == k then if premium and isPremium(cid) then if not getPlayerBlessing(cid, k) then if doPlayerRemoveMoney(cid, v[2]) then doPlayerAddBlessing(cid, k) selfSay("You received the bless " .. v[1]:gsub("The ", "", 1) .. "!", cid) doSendMagicEffect(getThingPos(cid), 10) else selfSay("You no have money.", cid) end else selfSay("You have " .. v[1] .. ".", cid) end else selfSay("You need premium account.", cid) end talkState[talkUser] = 0 end end end if msgcontains(msg:lower(), "no") and talkState[talkUser] >= 1 then selfSay("Bye!!", cid) talkState[talkUser] = 0 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
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.