Bom criei uma area vip para o meu ot, so que eu queria criar um npc combrando 1kk para deixar os player passar!
alguem sabe como fazer isso?
Bom criei uma area vip para o meu ot, so que eu queria criar um npc combrando 1kk para deixar os player passar!
alguem sabe como fazer isso?
"Para que levar a vida tão a sério, se a vida é uma alucinante aventura da qual jamais sairemos vivos."
NPC:
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 local talkState = {} 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 price = 1000000 local days = 30 local daysvalue = days * 24 * 60 * 60 local storageplayer = getPlayerStorageValue(cid, 13540) local timenow = os.time() if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then time = timenow + daysvalue else time = storageplayer + daysvalue end if msgcontains(msg, "vip") then selfSay("you buy " .. days .. " vip for " .. price .. " Are you sure?", cid) talkState[talkUser] = 1 elseif(msgcontains(msg, "yes") and talkState[talkUser] == 1)then if doPlayerRemoveMoney(cid, price) == TRUE then selfSay('From now, you are vip!', cid) setPlayerStorageValue(cid, 13540, time) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) else selfSay('You don\'t have '.. price ..'', cid) talkState[talkUser] = 0 npcHandler:releaseFocus(cid) end elseif msg == "no" and talkState[talkUser] == 1 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())
chão só para vips passar:
vipe.lua
function onStepIn(cid, item, position, fromPosition) local config = { msgDenied = "Vc nao e vip , compre com o NPC.", msgWelcome = "Seja Bem Vindo a Area vip." } if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgDenied) doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return TRUE end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.msgWelcome) return TRUE end
<movevent type="StepIn" uniqueid="13700" event="script" value="vipe.lua"/>
Boa garoto!
Vou testa aqui e se funfa eu agradeço depois!
"Para que levar a vida tão a sério, se a vida é uma alucinante aventura da qual jamais sairemos vivos."
+Rep para Vodkart por atender o pedido.
Tópico Movido para a seção Pedidos Entregues.
Moderador Xtibia.com
Helio@xtibia.com