Ir para conteúdo
  • 0

Script Com Storage Como Tirar ?


pesadeloxx

Pergunta

Ola. eu tenhu um script q gostei mtu e keria saber ce tem como tirar o Storage para q num fike falando q jah foi usado e n pode usar +.

 

o script éh esse :

function getTime(s)
   local n = math.floor(s / 60)
   s = s - (60 * n)
   return n, s
end
CreatureEventChecker = function(event, ...) -- Colex
   if isCreature(arg[1]) then
    event(unpack(arg))
   end
end
creatureEvent = function(event, delay, ...) -- Colex
   addEvent(CreatureEventChecker, delay, event, unpack(arg))
end

function onUse(cid,item,frompos,item2,topos)
------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE
configs = {
time = 300, ---- TIME IN MINUTES
needpa = TRUE,
needlvl = {TRUE, level = 1},
costmana = {TRUE, mana = 10},
removeonuse = TRUE
}
----------------------------------

--------- Nao Mude --------------
if getPlayerStorageValue(cid, 62165) >= 1 then
   return doPlayerSendCancel(cid, "You are already taking effect from this item.")
end
if configs.needpa and not isPremium(cid) then
   return doPlayerSendCancel(cid, "You need to be a premmium account to use this item.")
end
if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then
   return doPlayerSendCancel(cid, "You need to be level " .. configs.needlvl.level .. " to use this item.")
end
if configs.costmana[1] then
if getCreatureMana(cid) < configs.costmana.mana then
   return doPlayerSendCancel(cid, "You need " .. configs.costmana.mana .. " mana to use this item.")
else
doCreatureAddMana(cid, -configs.costmana.mana)
end
end
if configs.removeonuse then
   doRemoveItem(item.uid, 1)
end

for i = configs.time*60, 1, -1 do
local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60))
if #a < 4 then
a = string.sub(a,1,2) .. "0" .. string.sub(a, 3)
end
if i == configs.time*60 then
creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "The effect of the double exp potion end.")
end
creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "The effect of the double exp will end in "..a..".")
end
doPlayerSetExperienceRate(cid, 2)
creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1)
doPlayerSendTextMessage(cid, 22, "Agora voce ira receber o dobro de exp por matar os mosntros.")
setPlayerStorageValue(cid, 62165, os.time())
creatureEvent(setPlayerStorageValue, configs.time *60*1000, cid, 62165, 0)
return TRUE
end
-------------------------------------

 

OBS: após usar umas 6x ele fala q num pode + ser usado ;/ dou REP+ lógico

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

tenta sssim

function getTime(s)
   local n = math.floor(s / 60)
   s = s - (60 * n)
   return n, s
end
CreatureEventChecker = function(event, ...) -- Colex
   if isCreature(arg[1]) then
	    event(unpack(arg))
   end
end
creatureEvent = function(event, delay, ...) -- Colex
   addEvent(CreatureEventChecker, delay, event, unpack(arg))
end

function onUse(cid,item,frompos,item2,topos)
configs = {
time = 300,
needpa = TRUE,
needlvl = {TRUE, level = 1},
costmana = {TRUE, mana = 10},
removeonuse = TRUE
}

if configs.needpa and not isPremium(cid) then
   return doPlayerSendCancel(cid, "You need to be a premmium account to use this item.")
end
if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then
   return doPlayerSendCancel(cid, "You need to be level " .. configs.needlvl.level .. " to use this item.")
end
if configs.costmana[1] then
if getCreatureMana(cid) < configs.costmana.mana then
   return doPlayerSendCancel(cid, "You need " .. configs.costmana.mana .. " mana to use this item.")
else
doCreatureAddMana(cid, -configs.costmana.mana)
end
end
if configs.removeonuse then
   doRemoveItem(item.uid, 1)
end

for i = configs.time*60, 1, -1 do
local a = math.floor(i/60) .. ":" .. i - (60 * math.floor(i/60))
if #a < 4 then
a = string.sub(a,1,2) .. "0" .. string.sub(a, 3)
end
if i == configs.time*60 then
creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "The effect of the double exp potion end.")
end
creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, "The effect of the double exp will end in "..a..".")
end
doPlayerSetExperienceRate(cid, 2)
creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1)
doPlayerSendTextMessage(cid, 22, "Agora voce ira receber o dobro de exp por matar os mosntros.")
return TRUE
end

Link para o comentário
Compartilhar em outros sites

  • 0

Bem simplesmente coloca o valor 1 :

 

 

 

function getTime(s)

local n = math.floor(s / 60)

s = s - (60 * n)

return n, s

end

CreatureEventChecker = function(event, ...) -- Colex

if isCreature(arg[1]) then

event(unpack(arg))

end

end

creatureEvent = function(event, delay, ...) -- Colex

addEvent(CreatureEventChecker, delay, event, unpack(arg))

end

function onUse(cid,item,frompos,item2,topos)

------ CONFIGURE SEU SCRIPT ------ TRUE ou FALSE

configs = {

time = 300, ---- TIME IN MINUTES

needpa = TRUE,

needlvl = {TRUE, level = 1},

costmana = {TRUE, mana = 10},

removeonuse = TRUE

}

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

--------- Nao Mude --------------

if getPlayerStorageValue(cid, 62165) >= 1 then

return doPlayerSendCancel(cid, "You are already taking effect from this item.")

end

if configs.needpa and not isPremium(cid) then

return doPlayerSendCancel(cid, "You need to be a premmium account to use this item.")

end

if configs.needlvl[1] and getPlayerLevel(cid) < configs.needlvl.level then

return doPlayerSendCancel(cid, "You need to be level " .. configs.needlvl.level .. " to use this item.")

end

if configs.costmana[1] then

if getCreatureMana(cid) < configs.costmana.mana then

return doPlayerSendCancel(cid, "You need " .. configs.costmana.mana .. " mana to use this item.")

else

doCreatureAddMana(cid, -configs.costmana.mana)

end

if configs.removeonuse then

doRemoveItem(item.uid, 1)

end

if i == configs.time*60 then

creatureEvent(doPlayerSendCancel, configs.time*60*1000, cid, "The effect of the double exp potion end.")

end

creatureEvent(doPlayerSendCancel, (configs.time*60-i)*1000, cid, " ")

end

doPlayerSetExperienceRate(cid, 2)

creatureEvent(doPlayerSetExperienceRate, configs.time *60*1000, cid, 1)

doPlayerSendTextMessage(cid, 22, "Agora voce ira receber o dobro de exp por matar os mosntros.")

setPlayerStorageValue(cid, 62165, os.time())

creatureEvent(setPlayerStorageValue, 1, cid, 62165, 0)

return TRUE

end

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

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...