function onStepIn(cid, item, position, fromPosition)
if not isPlayer(cid) == true then
return true
end
local c = {
rand = math.random(1, 50),
pos = getThingPos(cid),
monster = "Ghost",
msg = "What the hell is that!?",
}
if (c.rand == 1) then
doSummonCreature(c.monster, c.pos)
doCreatureSay(cid, c.msg, 1)
end
end
<movevent type="StepIn" actionid="XXXX" event="script" value="xxxx.lua"/>






info
Grupo: Campones
Registrado: 05/09/08
Posts: 21
Reputação: +2
Galera, fiz um movement, a a ideia é que ao passar em um tile com actionid="412", o player tenha 2% de chance de atrair um fantasma.
Ou seja, vc ta andando lá, e do nada, um fantasma surge e começa a atacar.
Sendo, que é uma tumba e quase todos os tiles dela tem o actionid="412"
Tentei da seguinte maneira, mas sem nenhum resultado. Sim, nenhum. Nada acontece, mesmo removendo o random:
function onStepIn(cid, item, position, fromPosition)
if isPlayer(cid) == TRUE then
rand = math.random(1, 50)
pos = getThingPos(cid)
if (rand == 1) then
doCreateMonster("Ghost", pos)
doCreatureSay(cid, "What the hell is that!?", 1)
end
end
return TRUE
end
E Aqui no movements.xml
<movevent event="StepIn" actionid="412" script="ghost.lua"/>
E outra duvida, baixei um Mix Yourots 1.0.0, e nele o fire field é bugadinho.
Quando pisa no fire field, nao tira vida. Mas se ficar parado em cima, depois de uns 20 segundos, você começa a levar hits do fogo (20) que nao param até que saia de cima.