[Encerrado] ayuda en movement

samuelitho
em Tópicos Sem Resposta

samuelitho

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 04/12/11Posts: 79

cnecesito su ayuda para hacer que cada pokemon nasca con nivel diferente ejemplo que butterfly nasca nivel 30, metapod lvl 10, caterpie 5 

Spoiler
local cfg = {
monsters = {"Butterfly", "Metapod", "Caterpie", "Pidgey", "Beedrill", "Meowth", "Pidgeotto"},
grassChance = 25, -- % chance create monster
timeTo = 5, -- Seconds so you can use them again
}

function onStepIn(cid, item, pos)

if not isPlayer(cid) then return true end
if getGlobalStorageValue(14260) > os.time() then return true end

if math.random(100) <= cfg.grassChance then
doCreateMonster(cfg.monsters[math.random(1, #cfg.monsters)], getCreaturePosition(cid))
addEvent(doSendMagicEffect, 1 * 1000, getCreaturePosition(cid), 14)
setGlobalStorageValue(14260, os.time() + cfg.timeTo)
end
return true
end

 

samuelitho

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 04/12/11Posts: 79

up

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino
local cfg = {
monsters = {"Butterfly", "Metapod", "Caterpie", "Pidgey", "Beedrill", "Meowth", "Pidgeotto"},


grassChance = 25, -- % chance create monster
timeTo = 5, -- Seconds so you can use them again
}

function onStepIn(cid, item, pos)

if not isPlayer(cid) then return true end
if getGlobalStorageValue(14260) > os.time() then return true end

if math.random(100) <= cfg.grassChance then
if getCreatureName(cid) == "Butterfly" or getCreatureName(cid) == "Metapod" or getCreatureName(cid) == "Caterpie" or getCreatureName(cid) == "Pidgey" or getCreatureName(cid) == "Beedrill" or getCreatureName(cid) == "Meowth" or getCreatureName(cid) == "Pidgeotto" or getCreatureName(cid) == "Marshtomp" then

end
doCreateMonster(cfg.monsters[math.random(1, #cfg.monsters)], getCreaturePosition(cid))
local lvl = math.random(10, 30) 
local nick = ""..getCreatureName(cid).." ["..lvl.."]" 
doCreatureSetNick(cid, nick) 
addEvent(doSendMagicEffect, 1 * 1000, getCreaturePosition(cid), 14)
setGlobalStorageValue(14260, os.time() + cfg.timeTo)
end
return true
end

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end

 

 

 

Marshmello

Alone ~ [✖‿✖]
avatar
Conde
Conde

INFOS

Grupo: CondeRegistrado: 21/04/16Posts: 831Gênero: Masculino
A questão neste suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.

placa1.png.90a184502351cebe72cd7b69751e551d.png

Meu Facebook

INFOS:

Citar

CIDADE: Rio de janeiro

Idade: 22 anos
SOU: {"Scripter(lua)", "WebMaster", "ProgramadorC++"}
 

local config = {
	delrey = getPlayerCarValue(cid, DELREY),
	cigarro = getPlayerCancer(cid, DERBY),
	prostituta = getPlayerAIDS(cid, cracuda),
	tresOitao = getPlayerRevorvi(cid, 38)
}
if(delrey == "Ligado" and cigarro == "Aceso" and prostituta == "No Colo" and tresOitao == "Carregado") then
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Começou o fim de semana. #PAS")
end