Ir para conteúdo
  • 0

potion que so player premium use


ntoserver

Pergunta

queria sabe como ponho pra somente player premium use a potion vo deixa aki a baixo esse scripts e do nto shippuden da pill ma queria por so pra premium usa

 

local temp = {

exhausted = 2,
storage = 2100
}
local confg = {
level = 100,
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local hp = 50000
local mp = 50000
if(getPlayerStorageValue(cid, temp.storage) > os.time() and getPlayerStorageValue(cid, temp.storage) < 100+os.time()) then
doPlayerSendTextMessage(cid, 24, "você esta exausto, espere " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' segundo' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 2 and "" or "s"))
return true
elseif getPlayerLevel(cid) < confg.level then
doPlayerSendCancel(cid, "You need to be atleast level ".. confg.level ..".")
return true
end
doCreatureAddHealth(cid, hp)
doCreatureAddMana(cid, mp)
doSendMagicEffect(getCreaturePosition(cid), 13)
doRemoveItem(item.uid,1)
setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted)
return true
end
Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Testa ae !

 

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local temp = {
exhausted = 2,
storage = 2100
}
local confg = {
level = 100,
}
 
local hp = 50000
local mp = 50000
local premium = "sim"
 
    if(getPlayerStorageValue(cid, temp.storage) > os.time() and getPlayerStorageValue(cid, temp.storage) < 100+os.time()) then
      doPlayerSendTextMessage(cid, 24, "você esta exausto, espere " .. getPlayerStorageValue(cid, temp.storage) - os.time() .. ' segundo' .. ((getPlayerStorageValue(cid, temp.storage) - os.time()) == 2 and "" or "s"))
 return true
    elseif getPlayerLevel(cid) < confg.level then
      doPlayerSendCancel(cid, "You need to be atleast level ".. confg.level ..".")
 return true
end
    if premium == "sim" and not isPremium(cid) then
       doCreatureAddHealth(cid, hp)
       doCreatureAddMana(cid, mp)
       doSendMagicEffect(getCreaturePosition(cid), 13)
       doRemoveItem(item.uid,1)
       setPlayerStorageValue(cid, temp.storage, os.time() + temp.exhausted)
   return true
end
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...