Ir para conteúdo

f..silva

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    f..silva deu reputação a Blackmotion em (Resolvido)[Pedido] Npc Teleport com Level   
    Não testei sou novo nesses bang de script ...
     
    carlos.lua
    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 local cfg = { toPos = {x=1789, y=3667, z=7}, -- Posição level = 50, -- Level necessário price = 30 -- Dinheiro cobrado } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'travel') then selfSay('You are sure you want to go?', cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if getPlayerLevel(cid) >= cfg.level then if doPlayerRemoveMoney(cid, cfg.price) then doTeleportThing(cid, cfg.toPos) talkState[talkUser] = 0 else selfSay('You don\'t have enough money.', cid) end else selfSay('You need level having above '.. cfg.level ..'.', cid) end elseif msgcontains(msg, 'no') then selfSay('bye', cid) end end end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) carlos.xml
    <?xml version="1.0" encoding="UTF-8"?> <npc name="Carlos" script="data/npc/scripts/carlos.lua" walkinterval="25" floorchange="0" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="128" head="114" body="12" legs="57" feet="114" addons="0" /> <parameters> <parameter key="message_greet" value="Hello, |PLAYERNAME|! Would like to {travel} ?"/> <parameter key="message_walkaway" value="Hey, where you go ?"/> <parameter key="message_farewell" value="Bye!"/> </parameters> </npc> #Edit
  2. Gostei
    f..silva deu reputação a Beeny em Gesior 1.0 Moderado Por Min -V1   
    é prints
    não sprints ajsoesao

Informação Importante

Confirmação de Termo