Ir para conteúdo
  • 0

Headbutt


BrunooMaciell

Pergunta

Entao meu sistema de headbutt queria por ele pra premium account.

 

System

local tempo = 10 -- tempo em segundos

local monsters = {                                                            
    [100] = {"Pidgey", "Spearow", "Budew", "Sunkern", "Cherubi"},        --[chance] = {para cair um dos monstros}
    [80] = {"Ledyba", "Sentret", "Wurmple", "Hoppip", "Spinarak"},
    [70] = {"Pidove", "Petilil", "Ferroseed"},
    [60] = {"Kakuna", "Metapod", "Silcoon", "Cascoon", "Vullaby"},
    [50] = {"Pineco", "Bonsly", "Cherrim", "Taillow", "Durant"},
    [40] = {"Starly", "Combee", "Natu", "Hoothoot", "Larvesta"},
    [30] = {"Woobat", "Sewaddle", "Cottonee", "Swadloon"},
    [20] = {"Chatot", "Beedrill", "Butterfree", "Ledian", "Skiploom"},
    [10] = {"Yanma", "Beautifly", "Dustox", "Masquerain", "Kricketot"},
    [8] = {"Pidgeot", "Tranquill", "Rufflet", "Archen", "Volcarona"},
    [7] = {"Venomoth", "Farfetch'D", "Murkrow", "Forretress", "Ninjask"},
    [6] = {"Staravia", "Vespiquen", "Yanmega", "Swoobat", "Honchkrow"},
    [5] = {"Fearow", "Pidgeot", "Noctowl", "Xatu", "Ariados", "Mandibuzz"},
    [3] = {"Swellow", "Shedinja", "Staraptor", "Kricketune"},
    [2] = {"Braviary", "Unfezant", "Archeops"},
}                                                    

function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid, 23491) >= os.time() then
    doPlayerSendCancel(cid, "You must wait " .. tempo .. " to use again.")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    return true
end
local e = {2,3,4,5,6,9}
local t = {}
for _, v in pairs(monsters) do 
table.insert(t, _)
end
table.sort(t)
for _, v in pairs(t) do
if math.random(1, 100) < v then
c = v
break
end
end
local m = monsters[c][math.random(1,#monsters[c])]
local monster = doCreateMonster(m, getPlayerPosition(cid))
doSendMagicEffect(getCreaturePosition(monster), CONST_ME_TELEPORT)
doSendMagicEffect(toPosition, e[math.random(1,#e)])
doCreatureSay(monster, m.." was hidden on top of the tree! HAHAHA!", TALKTYPE_ORANGE_1)
setPlayerStorageValue(cid, 23491, tempo + os.time())
return true
end

Rep+++

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0
local tempo = 10 -- tempo em segundos

local monsters = {                                                            
    [100] = {"Pidgey", "Spearow", "Budew", "Sunkern", "Cherubi"},        --[chance] = {para cair um dos monstros}
    [80] = {"Ledyba", "Sentret", "Wurmple", "Hoppip", "Spinarak"},
    [70] = {"Pidove", "Petilil", "Ferroseed"},
    [60] = {"Kakuna", "Metapod", "Silcoon", "Cascoon", "Vullaby"},
    [50] = {"Pineco", "Bonsly", "Cherrim", "Taillow", "Durant"},
    [40] = {"Starly", "Combee", "Natu", "Hoothoot", "Larvesta"},
    [30] = {"Woobat", "Sewaddle", "Cottonee", "Swadloon"},
    [20] = {"Chatot", "Beedrill", "Butterfree", "Ledian", "Skiploom"},
    [10] = {"Yanma", "Beautifly", "Dustox", "Masquerain", "Kricketot"},
    [8] = {"Pidgeot", "Tranquill", "Rufflet", "Archen", "Volcarona"},
    [7] = {"Venomoth", "Farfetch'D", "Murkrow", "Forretress", "Ninjask"},
    [6] = {"Staravia", "Vespiquen", "Yanmega", "Swoobat", "Honchkrow"},
    [5] = {"Fearow", "Pidgeot", "Noctowl", "Xatu", "Ariados", "Mandibuzz"},
    [3] = {"Swellow", "Shedinja", "Staraptor", "Kricketune"},
    [2] = {"Braviary", "Unfezant", "Archeops"},
}                                                    

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 23491) >= os.time() then
		doPlayerSendCancel(cid, "You must wait " .. tempo .. " to use again.")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return true
	end
	if not isPremium(cid) then
		doPlayerSendCancel(cid, "You need premium account.")
		return true
	end
	local e = {2,3,4,5,6,9}
	local t = {}
	for _, v in pairs(monsters) do 
		table.insert(t, _)
	end
	table.sort(t)
	for _, v in pairs(t) do
		if math.random(1, 100) < v then
			c = v
			break
		end
	end
	local m = monsters[c][math.random(1,#monsters[c])]
	local monster = doCreateMonster(m, getPlayerPosition(cid))
	doSendMagicEffect(getCreaturePosition(monster), CONST_ME_TELEPORT)
	doSendMagicEffect(toPosition, e[math.random(1,#e)])
	doCreatureSay(monster, m.." was hidden on top of the tree! HAHAHA!", TALKTYPE_ORANGE_1)
	setPlayerStorageValue(cid, 23491, tempo + os.time())
	return true
end

 

Link para o comentário
Compartilhar em outros sites

  • 0
29 minutos atrás, lSainty disse:

local tempo = 10 -- tempo em segundos

local monsters = {                                                            
    [100] = {"Pidgey", "Spearow", "Budew", "Sunkern", "Cherubi"},        --[chance] = {para cair um dos monstros}
    [80] = {"Ledyba", "Sentret", "Wurmple", "Hoppip", "Spinarak"},
    [70] = {"Pidove", "Petilil", "Ferroseed"},
    [60] = {"Kakuna", "Metapod", "Silcoon", "Cascoon", "Vullaby"},
    [50] = {"Pineco", "Bonsly", "Cherrim", "Taillow", "Durant"},
    [40] = {"Starly", "Combee", "Natu", "Hoothoot", "Larvesta"},
    [30] = {"Woobat", "Sewaddle", "Cottonee", "Swadloon"},
    [20] = {"Chatot", "Beedrill", "Butterfree", "Ledian", "Skiploom"},
    [10] = {"Yanma", "Beautifly", "Dustox", "Masquerain", "Kricketot"},
    [8] = {"Pidgeot", "Tranquill", "Rufflet", "Archen", "Volcarona"},
    [7] = {"Venomoth", "Farfetch'D", "Murkrow", "Forretress", "Ninjask"},
    [6] = {"Staravia", "Vespiquen", "Yanmega", "Swoobat", "Honchkrow"},
    [5] = {"Fearow", "Pidgeot", "Noctowl", "Xatu", "Ariados", "Mandibuzz"},
    [3] = {"Swellow", "Shedinja", "Staraptor", "Kricketune"},
    [2] = {"Braviary", "Unfezant", "Archeops"},
}                                                    

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, 23491) >= os.time() then
		doPlayerSendCancel(cid, "You must wait " .. tempo .. " to use again.")
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
		return true
	end
	if not isPremium(cid) then
		doPlayerSendCancel(cid, "You need premium account.")
		return true
	end
	local e = {2,3,4,5,6,9}
	local t = {}
	for _, v in pairs(monsters) do 
		table.insert(t, _)
	end
	table.sort(t)
	for _, v in pairs(t) do
		if math.random(1, 100) < v then
			c = v
			break
		end
	end
	local m = monsters[c][math.random(1,#monsters[c])]
	local monster = doCreateMonster(m, getPlayerPosition(cid))
	doSendMagicEffect(getCreaturePosition(monster), CONST_ME_TELEPORT)
	doSendMagicEffect(toPosition, e[math.random(1,#e)])
	doCreatureSay(monster, m.." was hidden on top of the tree! HAHAHA!", TALKTYPE_ORANGE_1)
	setPlayerStorageValue(cid, 23491, tempo + os.time())
	return true
end

 

Deu certo ^^

 

Vlww ? 

Link para o comentário
Compartilhar em outros sites

  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...