Ir para conteúdo

Featured Replies

Postado

boa noite galera gostaria de um script que o player so poderia passar se tiver x reset . tipo tem uma sala com varios bichos e que gostaria de por em varios lugares . vlw galera 

  • Respostas 13
  • Visualizações 1.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local config = {    resets = 2,    msg = "Você não tem resets suficientes para acessar esta área.", } function onStepIn(cid, item, fromPos)    if not isPlayer(cid) then       return false    end      

Postado
  • Autor

Boa noite Eratsu o system reset que eu usso e por npc e esse aki em baixo olha mano se poder ajudar agradecido.

 

--[[script made 100% by Nogard and Night Wolf.

   You can feel free to edit anything you want, but don't remove the credits]] 
 
 
 
 
local config = {
minlevel = 1000, --- level inical para resetar
price = 10000, --- preço inicial para resetar
newlevel = 20, --- level após reset
priceByReset = 10000, --- preço acrescentado por reset
levelbyreset = 1500 --- quanto de level vai precisar a mais no próximo reset
}
--- end config
 
function addReset(cid)
resets = getResets(cid)
setPlayerStorageValue(cid, 378378, resets+1) 
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doRemoveCreature(cid)
db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..resets.."]' WHERE `players`.`id` = "..playerid)
db.executeQuery("UPDATE `players` SET `level` = "..config.newlevel..", `experience` = 0 WHERE `id` = "..playerid)
return TRUE
end
 
function getResets(cid)
resets = getPlayerStorageValue(cid, 378378)
if resets < 0 then
resets = 0
end
return resets
end
 
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 creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
 
 
local newPrice = config.price + (getResets(cid) * config.priceByReset)
local newminlevel = config.minlevel + (getResets(cid) * config.levelbyreset)
 
if msgcontains(msg, 'reset') then
if getResets(cid)  == resets then
selfSay('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid)
talkState[talkUser] = 1
else
selfSay('I couldnt acess your bank of acess!', cid)
end
elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
if getPlayerMoney(cid) < newPrice then
selfSay('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid)
elseif getPlayerLevel(cid) < newminlevel then
selfSay('The minimum level for reseting is '..newminlevel..'!', cid)
else
doPlayerRemoveMoney(cid,newPrice)
playerid = getPlayerGUID(cid)
addEvent(addReset, (5*1000), cid)
  local msg ="---[Reset: "..getResets(cid).."]-- You have reseted!  You'll be disconnected in 5 seconds."
        if doPlayerPopupFYI(cid, msg) then
        
        end
 
 
 
 
end
talkState[talkUser] = 0
elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then
talkState[talkUser] = 0
selfSay('Ok.', cid)
elseif msgcontains(msg, 'quantity') then
selfSay('You have a total of '..getResets(cid)..' reset(s).', cid)
end
return true
end
 
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Postado

local config = {
   resets = 2,
   msg = "Você não tem resets suficientes para acessar esta área.",
}
function onStepIn(cid, item, fromPos)
   if not isPlayer(cid) then
      return false
   end
 
   if getResets(cid) < config.resets then
      doTeleportThing(cid, fromPos, true)
      doPlayerSendCancel(cid, config.msg)
      return false
   end
 
   return true
end

 

<movevent type="StepIn" actionid="ACTIONID" event="script" value="SEUSCRIPT.lua"/>

-"Supra Omnes Lux Lucis"

- Acima de todos brilha a Luz -

5VGnDyBz.png

Postado
  • Autor

ae mano vlw , testei aki mas deu erro olha.

 

 

[03/05/2014 22:38:37] [Error - MoveEvents Interface] 

[03/05/2014 22:38:37] data/movements/scripts/Reset/reset2.lua:onStepIn
[03/05/2014 22:38:37] Description: 
[03/05/2014 22:38:37] data/movements/scripts/Reset/reset2.lua:10: attempt to call global 'getResets' (a nil value)
[03/05/2014 22:38:37] stack traceback:
[03/05/2014 22:38:37] data/movements/scripts/Reset/reset2.lua:10: in function <data/movements/scripts/Reset/reset2.lua:5>

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.7k

Informação Importante

Confirmação de Termo