Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Nome: Present

Tipo de arquivo: Npc

Versão: 8.6x

Bem pessoal, estava demorando para postar esse npc maravilhoso de uma ídeia genial que eu tive e será; maravilhosamente útil para vocês (creio eu).

Oque ele faz?

  • O player pode falar com o npc e pegar 1 presente por dia
  • Não adianta burlar, o player só poderá; pegar 1 presente por dia
  • O NPC Zera todos os dias às 00:00 (criando novas Storagevalue)
  • O npc zera altomaticamente
  • O horario é configurado de acordo com o horario do seu computador
  • Após o npc zerar, o player poderá pegar o presente diario dele, e só poderá pegar outro no proximo dia
  • Funciona perfeitamente na versão 8.60 TFS 0.4

O NPC usa a função "string.sub(os.date()".

Abra a pasta data/npc/scripts/ e crie um documento de texto .lua com o nome present e cole isso:


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

	---------------- config msg ------------------

	local frase1 = 'Present'  -- (Player) -- Oque o player ira dizer para o npc --

	local frase2 = 'Presente'  -- (Player) -- Oque o player ira dizer para o npc² --

	local frase3 = 'Você quer o presente agora?'-- Npc)  -- voce quer agora? --

	local frase4 = 'yes' -- (Player) -- yes --

	local frase5 = 'Me desculpe! Você já ganhou hoje.' -- (Npc) -- voce ja ganhou por hj --

	local frase6 = 'Obrigado, volte sempre' -- (Npc) -- aqui esta e seja feliz --

	local frase7 = 'no' -- (Player) -- nao --

	local frase8 = 'ok, poderas pegar mais tarde' -- (Npc) -- ok entao pega mais tarde --

	local storage = 3333 -- storage que define o dia nao mexa a nao ser que saiba ps: use uma storage que nao esteja sendo usada =D--

	local itemid = 7702 -- Present Diary --

	----------------------------------------------

	if (msgcontains(msg, frase1) or msgcontains(msg, frase2)) and getPlayerStorageValue(cid, storage) == tonumber(string.sub(os.date(),4,5)) then

				selfSay(frase5, cid)

	elseif(msgcontains(msg, frase1) or msgcontains(msg, frase2)) then

		selfSay(frase3, cid)

		talkState[talkUser] = 1

	elseif(msgcontains(msg, frase4) and talkState[talkUser] == 1) then

			selfSay(frase6, cid)

			setPlayerStorageValue(cid, storage, tonumber(string.sub(os.date(),4,5)))

			doPlayerAddItem(cid, itemid)

		talkState[talkUser] = 0

	elseif(msgcontains(msg, frase7) and isInArray({1}, talkState[talkUser]) == TRUE) then

		talkState[talkUser] = 0

		selfSay(frase8, cid)

		end

	return TRUE

end


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

Nem preciso ensinar como configurar né? Agora em data/npc/ crie um arquivo .xml e renomeie para present, abra-o e adicione:

<?xml version="1.0" encoding="UTF-8"?>

<npc name="Fiscal da presenca" script="Present.lua" walkinterval="2000" floorchange="0">

	<health now="100" max="100"/>

	<look type="128" head="17" body="54" legs="114" feet="0" addons="3"/>

	<parameters>

		<parameter key="message_greet" value="Hello |PLAYERNAME|, I am a Present diary! Say {present} to receive your gift today."/>

	</parameters>

</npc>

EDIT: O item 7702 que está no script, é um item que eu fiz que dar ao player muitos outros items, como uma bousa de items, que ao clicar, dar items Random entre 1 a 15... Você poderá colocar o ID que quiser, também poderá pegar minha ideia se preferir... Caso gostaria de por esse script na pagina do seu gesior ta aqui. Para adicionar, va até Htdocs ou www/ e crie um arquivo .php com o nome Present e adicione isso:

<HTML>

<HEAD>

<TITLE>

<?php

	$main_content .= '

	<h1><center><b>Presen&ccedil;a Di&aacute;ria<h1></center></b>

<table width="100%" cellspacing=1 cellpadding=4 border="0">

  <tr bgcolor="'.$config['site']['vdarkborder'].'">

	<th align="left">Legenda</th>

  </tr>

  <tr bgcolor="'.$config['site']['darkborder'].'">

	<td align="left" valign="top">

	<ul>

	<li>

	<strong>

	Você terá a oportunidade de participar da Missão de Presença Diária obtida com a NPC Fiscal de Presença, ganhando recompensas diárias. São dez tipos de recompensas, então se programe para não perder nenhum dia do evento em busca da recompensa máxima!

	</strong>

	</li>

	  <br>

	  <li>

	<strong>

	  Essa é uma missão especial que fica disponível temporariamente de tempos em tempos. Basta já ter alcançado no mínimo o nível 200 para poder participar. Você pode repetir a missão diariamente e acumular prêmios.</td>

	</strong>

	</li>

	</ul>

  </tr>

</table>

<br>

<table width="100%" cellspacing=1 cellpadding=4 border="0">

  <tr bgcolor="'.$config['site']['vdarkborder'].'">

	<th width="100%">Como participar?</th>

  </tr>

</table>

<table cellspacing=1 cellpadding=4 width="100%" border="0">

  <tr bgcolor="'.$config['site']['darkborder'].'" align="center">

	<td width="100%" align="center"><strong>Primeiro, você precisa falar com o NPC Fiscal de Presença localizado próximo ao "NPC DE RINGS" na cidade principal de Draconia para pegar a Missão. Lembrando que você só pode pegar essa Missão uma vez por dia.</strong></td>

  </tr>

</table>

<br>

<table width="100%" cellspacing=1 cellpadding=4 border="0">

  <tr bgcolor="'.$config['site']['vdarkborder'].'">

	<th width="100%">E qual é essa recompensa?</th>

  </tr>

</table>

<table cellspacing=1 cellpadding=4 width="100%" border="0">

  <tr bgcolor="'.$config['site']['darkborder'].'" align="center">

	<td width="100%" align="center"><strong>Todo dia que você completar a Missão, vai receber um pacote de itens. Abaixo listarei os items disponiveis possiveis de dropar no "presencia diaria".</strong></td>

  </tr>

</table>

<br>

<table width="100%" cellspacing=1 cellpadding=4 border="0">

  <tr bgcolor="'.$config['site']['vdarkborder'].'">

	<th width="33%">Item</th>

	<th width="33%">Chance de droop</th>

  </tr>

</table>

<table cellspacing=1 cellpadding=4 width="100%" border="0">

  <tr bgcolor="'.$config['site']['darkborder'].'" align="center">

	<td width="33%" align="center"><strong>100k</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['lightborder'].'" align="center">

	<td width="33%"><strong>Magic Plate Armor</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['darkborder'].'" align="center">

	<td width="33%"><strong>Boots Of Haste</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['lightborder'].'" align="center">

	<td width="33%"><strong>Demon Shield</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['darkborder'].'" align="center">

	<td width="33%"><strong>Frozen Starlight</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['lightborder'].'" align="center">

	<td width="33%"><strong>Annihilation Bear</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['darkborder'].'" align="center">

	<td width="33%"><strong>Piece Of Draconian Steel</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['lightborder'].'" align="center">

	<td width="33%"><strong>Golden Legs</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['darkborder'].'" align="center">

	<td width="33%"><strong>Crown</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

  <tr bgcolor="'.$config['site']['lightborder'].'" align="center">

	<td width="33%"><strong>Goldfish Bowl</strong></td>

	<td width="33%"><strong>10%</strong></td>

  </tr>

</table>

<br>

<p align="right">

Page Present By: <a href="mailto:[email protected]">Weslley</a>


	';

?>

</TITLE>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">

</HEAD>

Agora em Index.php adicione:

   	 case "present":

				$topic = "Present Diary";

				$subtopic = "present";

				include("present.php");

		break;

Depois va em layout/.(nomedolayout)./layout.php abra e adicione:

<a href='?subtopic=present'>

  <div id='submenu_present' class='Submenuitem' onMouseOver='MouseOverSubmenuItem(this)' onMouseOut='MouseOutSubmenuItem(this)'>

	<div class='LeftChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

	<div id='ActiveSubmenuItemIcon_present' class='ActiveSubmenuItemIcon' style='background-image:url(<?PHP echo $layout_name; ?>/images/menu/icon-activesubmenu.gif);'></div>

	<div class='SubmenuitemLabel'>Presence diary</div>

	<div class='RightChain' style='background-image:url(<?PHP echo $layout_name; ?>/images/general/chain.gif);'></div>

  </div>

</a>

Screenshot:

semttulots.png

Script Present + pagina gesior.rar

Créditos: Willams 80%

............Subyth 20%

Editado por Subyth.
Adicionando QUOTE (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

bacana a idéia, mas tbm daria para usar os.time()

aliás, esse npc retorna quanto tempo falta para voltar a pegar o presente?

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites

Não, ele é basico.

Ele adiciona uma storagevalue ao player, quando é 00:00 hr no computador ele rezeta o storagevalue do player, mais não avisa o tempo que falta para pegar novamente.

Link para o post
Compartilhar em outros sites
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 = string.lower(msg)

local config = {

hours = 24,

storage = 58485,

rewards = {{itemid = 2173,chance = 15},{itemid = 2123,chance = 25},{itemid = 2160,chance = 30}} -- itens que ele poderá ganhar 

}

function doAddReward()

a = true

while a == true do

local m = math.random(1,#config.rewards)

if config.rewards[m].chance > math.random(1, 100) then

doPlayerAddItem(cid, config.rewards[m].itemid, isItemStackable(config.rewards[m].itemid) and 100 or 1)

npcHandler:say("seu prêmio foi: "..getItemNameById(config.rewards[m].itemid), cid)

a = false

end

end

end

if isInArray({"presente","present"}, msg) then

npcHandler:say("você deseja receber seu presente agora?! {yes}", cid)

talkState[talkUser] = 1

elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerStorageValue(cid,config.storage) <= os.time() then

doAddReward()

setPlayerStorageValue(cid, config.storage, os.time()+config.hours*3600)

else

npcHandler:say("Desculpe, mas você deve aguardar até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." para pegar seu presente novamente!", 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())

Editado por Vodkart (veja o histórico de edições)

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
  • 4 years later...
Em 06/05/2012 at 15:40, Vodkart disse:
 

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 = string.lower(msg)

local config = {

hours = 24,

storage = 58485,

rewards = {{itemid = 2173,chance = 15},{itemid = 2123,chance = 25},{itemid = 2160,chance = 30}} -- itens que ele poderá ganhar 

}

function doAddReward()

a = true

while a == true do

local m = math.random(1,#config.rewards)

if config.rewards[m].chance > math.random(1, 100) then

doPlayerAddItem(cid, config.rewards[m].itemid, isItemStackable(config.rewards[m].itemid) and 100 or 1)

npcHandler:say("seu prêmio foi: "..getItemNameById(config.rewards[m].itemid), cid)

a = false

end

end

end

if isInArray({"presente","present"}, msg) then

npcHandler:say("você deseja receber seu presente agora?! {yes}", cid)

talkState[talkUser] = 1

elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then

if getPlayerStorageValue(cid,config.storage) <= os.time() then

doAddReward()

setPlayerStorageValue(cid, config.storage, os.time()+config.hours*3600)

else

npcHandler:say("Desculpe, mas você deve aguardar até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." para pegar seu presente novamente!", 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())

 

 

Ótimo Script REP+

Téria como colocar pra somente level xx+ usar? Ex: level 120+ se for 120- o npc não dá o present?

Link para o post
Compartilhar em outros sites
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,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower()
local config = {
level = 120,
hours = 24,
storage = 58485,
rewards = {{itemid = 2173,chance = 15},{itemid = 2123,chance = 25},{itemid = 2160,chance = 30}} -- itens que ele poderá ganhar 
}
function doAddReward()
a = true
while a == true do
local m = math.random(1,#config.rewards)
if config.rewards[m].chance > math.random(1, 100) then
doPlayerAddItem(cid, config.rewards[m].itemid, isItemStackable(config.rewards[m].itemid) and 100 or 1)
npcHandler:say("seu prêmio foi: "..getItemNameById(config.rewards[m].itemid), cid)
a = false
end
end
end
if isInArray({"presente","present"}, msg) then
if getPlayerLevel(cid) < config.level then
npcHandler:say("Desculpe, mas você precisa ter no minimo level "..config.level.." para receber sua recompensa diaria.", cid)
else
npcHandler:say("você deseja receber seu presente agora?! {yes}", cid)
talkState[talkUser] = 1
end
elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if getPlayerStorageValue(cid,config.storage) <= os.time() then
doAddReward()
setPlayerStorageValue(cid, config.storage, os.time()+config.hours*3600)
else
npcHandler:say("Desculpe, mas você deve aguardar até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." para pegar seu presente novamente!", 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())

ok

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Link para o post
Compartilhar em outros sites
  • 4 weeks later...
Em 08/07/2016 ás 11:04, Vodkart disse:

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,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower()
local config = {
level = 120,
hours = 24,
storage = 58485,
rewards = {{itemid = 2173,chance = 15},{itemid = 2123,chance = 25},{itemid = 2160,chance = 30}} -- itens que ele poderá ganhar 
}
function doAddReward()
a = true
while a == true do
local m = math.random(1,#config.rewards)
if config.rewards[m].chance > math.random(1, 100) then
doPlayerAddItem(cid, config.rewards[m].itemid, isItemStackable(config.rewards[m].itemid) and 100 or 1)
npcHandler:say("seu prêmio foi: "..getItemNameById(config.rewards[m].itemid), cid)
a = false
end
end
end
if isInArray({"presente","present"}, msg) then
if getPlayerLevel(cid) < config.level then
npcHandler:say("Desculpe, mas você precisa ter no minimo level "..config.level.." para receber sua recompensa diaria.", cid)
else
npcHandler:say("você deseja receber seu presente agora?! {yes}", cid)
talkState[talkUser] = 1
end
elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if getPlayerStorageValue(cid,config.storage) <= os.time() then
doAddReward()
setPlayerStorageValue(cid, config.storage, os.time()+config.hours*3600)
else
npcHandler:say("Desculpe, mas você deve aguardar até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." para pegar seu presente novamente!", 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())

ok

 

Teria como por para o npc checar o ip do player ? pra não criarem outros personagens ou contas apenas para pegar o presente

Editado por chbuss (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • 6 months later...
  • 2 months later...

Desculpe reviver, mais eu preciso muito deste scrpt porem não encontro do jeito que preciso, ele funciona do jeitinho que esta ai porem sem level papra pegar o item e apenas mais um detalhe. para o player poder pegar o presente diário ele tem que ter x horas online no dia. Ex: se o cara ficou online 7 horas no total entre login's e logout's ele podera pegar o item do dia. se alguem puder ajudar.

Link para o post
Compartilhar em outros sites
  • 2 weeks later...
Em 2016-8-3 ás 22:23, WhiteBubble disse:

 

Teria como por para o npc checar o ip do player ? pra não criarem outros personagens ou contas apenas para pegar o presente

 

Alguém pode ajudar ?

 

Desculpe reviver, mais eu preciso muito deste script porem não encontro do jeito que preciso, ele funciona do jeitinho que esta ai porem sem level para pegar o item e apenas mais um detalhe. para o player poder pegar o presente diário ele tem que ter x horas online no dia. Ex: se o cara ficou online 7 horas no total entre login's e logout's ele poderá pegar o item do dia. se alguém puder ajudar.

Link para o post
Compartilhar em outros sites
  • 9 months later...
Em 08/07/2016 em 11:04, Vodkart disse:

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,msg = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid, msg:lower()
local config = {
level = 120,
hours = 24,
storage = 58485,
rewards = {{itemid = 2173,chance = 15},{itemid = 2123,chance = 25},{itemid = 2160,chance = 30}} -- itens que ele poderá ganhar 
}
function doAddReward()
a = true
while a == true do
local m = math.random(1,#config.rewards)
if config.rewards[m].chance > math.random(1, 100) then
doPlayerAddItem(cid, config.rewards[m].itemid, isItemStackable(config.rewards[m].itemid) and 100 or 1)
npcHandler:say("seu prêmio foi: "..getItemNameById(config.rewards[m].itemid), cid)
a = false
end
end
end
if isInArray({"presente","present"}, msg) then
if getPlayerLevel(cid) < config.level then
npcHandler:say("Desculpe, mas você precisa ter no minimo level "..config.level.." para receber sua recompensa diaria.", cid)
else
npcHandler:say("você deseja receber seu presente agora?! {yes}", cid)
talkState[talkUser] = 1
end
elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if getPlayerStorageValue(cid,config.storage) <= os.time() then
doAddReward()
setPlayerStorageValue(cid, config.storage, os.time()+config.hours*3600)
else
npcHandler:say("Desculpe, mas você deve aguardar até "..os.date("%d %B %Y %X ", getPlayerStorageValue(cid,config.storage)).." para pegar seu presente novamente!", 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())

ok

Bom dia

consegue colocar pra ele verificar o IP do player também?

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por RenanPhellip
      Eai pessoal, já tentei 3 scripts de teleport automático mas os 3 não funcionaram!
      Preciso que o teleport apareça automaticamente no templo aos sábados às 18h e feche às 21h contendo broadcast nos 2 horários.
    • Por tataboy67
      Opa galera beleza? Eu vi um cidadão aqui do forum pedindo, e para não reviver o tópico resolvi desenvolver 1 e postar  
      @ADM Mayk on BaiakME Ta ai o script que tu pediu.
       
      Crie um arquivo com o nome de Bau_Diario.lua
      local config = { items = { [1] = {2160, 10}, [2] = {2159, 10} }, level = 100, tempo = 24*60*60, -- 24 horas stoTime = 31402 } function onUse(player, item, fromPosition, itemEx, toPosition) if player:getLevel() >= config.level then if player:getStorageValue(config.stoTime) - os.time() < 0 then player:setStorageValue(config.stoTime, os.time() + config.tempo) for _, table in pairs(config.items) do for i=1, #config.items do player:addItem(table[i]) end end else player:getStorageValue(config.stoTime, 0) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, string.format("Wait: %s.", string.diff(player:getStorageValue(config.stoTime)-os.time()))) end else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Voce nao tem level "..config.level..".") end end
      Adicione a TAG em actions.xml
      <action actionid="22164" script="Bau_Diario.lua"/>
      Créditos: Eu
    • Por Sayadjin
      Boa Tarde.. Vim pedir um script normal e facil. 
      "16:09 [Super Rook 24h!] Caso ache algum bug avise a Staff e receba premios! Feito alcontrario e a staff descobri é ban delete sem aviso previo!"
      quero que fique soltando essa mensagem de 30 em 30 minutos de COR branca pra destacar. poderiam me Ajudar nisso???? REP+
    • Por Axion Nitron
      Bom Dia.
       
      Eu estou precisando de um script que ao primeiro char da conta logar ele ganha um item.
       
      Os itens são selecionados.
      Cada dia da semana ele ganha um item.
      Mas não é por player mais sim o presente para a conta toda.
    • Por Christinacsa
      PORTAL COM HORA E DIA PARA ABRIR
      Ex: Quero Que Segunda , QUARTA ,  Sabado . Abra 1 Portal Id Do Portal : 1387 , No Horario 12:00 e 18:00 Horas  , Position Eu Depois Coloco
      Tenha 1 Mensagem Em Vermelho : Torneio Foi Aberto No Templo Corra Pra Participar Do Torneio
       
      Rep + Para Quem Ajudar
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo