SA
pedido scripts

ayuda en movement

Por samuelitho, 23 de ago. de 2018 em Scripts

14
2.1k
samuelithoS
23 de agosto de 2018 às 19:46

como puedo hacer para que los pokemones spawn por nivel 

AQUI ESTA EL MOVEMENT COMO PUEDO EDITARLO PARA QUE SALGAN CON NIVEL

 

local cfg = {
monsters = {"Pidgey"},
grassChance = 15, -- % chance create monster
timeTo = 10, -- 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

23 de agosto de 2018 às 21:29

Teste o script dessa maneira

 

explicação:


    [1] = {monsters = "Pidgey", grassChance = 15, timeTo = 10, level = 100} 


          level  necessário para fazer o pidgey

 

script:

Spoiler

local config =
{
    [1] = {monsters = "Pidgey", grassChance = 15, timeTo = 10, level = 100} 
}
function onStepIn(cid, item, pos)
    
    for i=1, #config do
        
        if getPlayerLevel(cid) >= config.level then
        elseif getGlobalStorageValue(14260) > os.time() then 
        elseif math.random(100) <= config.grassChance then
            doCreateMonster(config.monsters[math.random(1, #config.monsters)], getCreaturePosition(cid))
            addEvent(doSendMagicEffect, 1 * 1000, getCreaturePosition(cid), 14)
            setGlobalStorageValue(14260, os.time() + config.timeTo)
        end
        return true
    end
end

 

Editado Agosto 24 por Poke X Ice

samuelithoS
24 de agosto de 2018 às 06:50
Eu queria dizer que o nível de pokemon nasca 5
samuelithoS
24 de agosto de 2018 às 22:41

up

up

samuelithoS
25 de agosto de 2018 às 20:42

up

samuelithoS
28 de agosto de 2018 às 00:58

up

samuelithoS
29 de agosto de 2018 às 03:00

up

samuelithoS
30 de agosto de 2018 às 22:13

up

samuelithoS
01 de setembro de 2018 às 10:12

up

 

samuelithoS
02 de setembro de 2018 às 06:13
17 horas atrás, Naruse disse:

Você quer que o pokémon nasça level 5 ?

Tente

 

local cfg = {
monsters = {"Pidgey"},
grassChance = 15, -- % chance create monster
timeTo = 10, -- 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)
doItemSetAttribute(item, "level", 5)
setGlobalStorageValue(14260, os.time() + cfg.timeTo)
end
return true
end

 

TESTE ASI NO FUNCA



local cfg = {{monsters = {"Pidgey"}, grassChance = 15, timeTo = 10, lvl = 5},
             {monsters = {"Rattata"}, grassChance = 10, timeTo = 10, lvl = 2},
             {monsters = {"Caterpie"}, grassChance = 5, timeTo = 10, lvl = 4},
}

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)
doItemSetAttribute(item, "level", cfg.lvl)
setGlobalStorageValue(14260, os.time() + cfg.timeTo)
end
return true
end

Editado Setembro 2 por samuelitho

samuelithoS
02 de setembro de 2018 às 11:18
2 horas atrás, Naruse disse:

Tenta não tirar o level, troca o "cfg.lvl" por 5 pra ve

[02/09/2018 06:17:37] [Error - MoveEvents Interface] 
[02/09/2018 06:17:37] data/movements/scripts/ruta1.lua:onStepIn
[02/09/2018 06:17:37] Description: 
[02/09/2018 06:17:37] (luaDoItemSetAttribute) Item not found

MarshmelloM
03 de setembro de 2018 às 01:44
14 horas atrás, samuelitho disse:

[02/09/2018 06:17:37] [Error - MoveEvents Interface] 
[02/09/2018 06:17:37] data/movements/scripts/ruta1.lua:onStepIn
[02/09/2018 06:17:37] Description: 
[02/09/2018 06:17:37] (luaDoItemSetAttribute) Item not found




local cfg = {{monsters = {"Pidgey"}, grassChance = 15, timeTo = 10, lvl = 5},
             {monsters = {"Rattata"}, grassChance = 10, timeTo = 10, lvl = 2},
             {monsters = {"Caterpie"}, grassChance = 5, timeTo = 10, lvl = 4},
}

function onStepIn(cid, 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)
doItemSetAttribute(item, "level", cfg.lvl)
setGlobalStorageValue(14260, os.time() + cfg.timeTo)
end
return true
end

Editado Setembro 3 por Marshmello

samuelithoS
03 de setembro de 2018 às 04:59
3 horas atrás, Marshmello disse:



local cfg = {{monsters = {"Pidgey"}, grassChance = 15, timeTo = 10, lvl = 5},
             {monsters = {"Rattata"}, grassChance = 10, timeTo = 10, lvl = 2},
             {monsters = {"Caterpie"}, grassChance = 5, timeTo = 10, lvl = 4},
}

function onStepIn(cid, 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)
doItemSetAttribute(item, "level", cfg.lvl)
setGlobalStorageValue(14260, os.time() + cfg.timeTo)
end
return true
end

[02/09/2018 23:59:13] [Error - MoveEvents Interface] 
[02/09/2018 23:59:13] data/movements/scripts/ruta1.lua:onStepIn
[02/09/2018 23:59:13] Description: 
[02/09/2018 23:59:13] data/movements/scripts/ruta1.lua:11: attempt to compare number with nil
[02/09/2018 23:59:13] stack traceback:
[02/09/2018 23:59:13]     data/movements/scripts/ruta1.lua:11: in function <data/movements/scripts/ruta1.lua:6>

samuelithoS
08 de setembro de 2018 às 08:34

up