Ir para conteúdo

Featured Replies

Postado
Em 11/02/2016 em 18:34, Jinx disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

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 itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

Muito Bom O Npc ,Funcionando Perfeitamente :)

Agora, Hokograma disse:

Muito Bom O Npc ,Funcionando Perfeitamente :)

 

 

                     Projeto    Nto Myth

 

" Eu to disposto a lutar e que se foda todo mundo que duvida que eu vou tocar o terror na porra toda! "

 

 

                                                                                                    bang.gif.bfc77cb73cf3065add6e416ceba6dc90.gif

 

 

  • 1 year later...
  • Respostas 6
  • Visualizações 4.1k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • tenho esse aque no meu server brother. e funfa !         local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParam

  • local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCre

Postado

ok

Em 11/02/2016 em 17:34, Jinx disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

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 itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

 

 

Em 11/02/2016 em 17:34, Jinx disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

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 itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

 

ok tem a script agora e como adiciono ele no mapa com nome e srprit? porque eu estou com dificuldades para add npc n sei como por spawn dele no server e nem como add ele no mapa no remes 

Em 11/02/2016 em 17:34, Jinx disse:

tenho esse aque no meu server brother. e funfa !

 

 

 

 

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 itemid = 2157 -- Novos points ( default é scarab coin )
local shopWindow = {}
local t = {
 [8850] = {price = 400}, -- [ID do item] e o preço que ele irá custar em points.
 [8929] = {price = 400},
 [8932] = {price = 400},
 [8926] = {price = 400},
 [2424] = {price = 400},
 [11296] = {price = 200},
 [11295] = {price = 200},
 [11298] = {price = 200},
 [11297] = {price = 200},
 [2527] = {price = 200},
 [2108] = {price = 900},
 [9019] = {price = 900},
 [3955] = {price = 900}
 }
local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks)
if  t[item] and getPlayerItemCount(cid, itemid) < t[item].price then
selfSay("you do not have "..t[item].price.." Nugget Coins.", cid)
else
doPlayerAddItem(cid, item)
doPlayerRemoveItem(cid, itemid, (t[item].price))
selfSay("Here you item", cid)
  end
return true
end
if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then
for var, ret in pairs(t) do
table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)})
end
openShopWindow(cid, shopWindow, onBuy, onSell)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())





Npc:

<?xml version="1.0"?>
<npc name="# Seller Super Rox @" script="data/npc/scripts/newcoin.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100"/>
<look type="53" head="87" body="0" legs="87" feet="0" addons="3"/>
<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I {trade} items for Nugget Coins!"/>
</parameters>
</npc>

 

e mais uma duvida como eu coloco o tipo do dinheiro nele igual vc fez com a scareb

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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo