• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Smoke Field

Ronaldino

Esso Eh
Joined
Dec 25, 2007
Messages
745
Reaction score
0
Hello.

I need that script, if monster step in smoke field then he dissapear. I think its simple but I'm noobish at LUA.
 
its dont work for me... I make it like that:

Code:
function onStepIn(cid, item, position, fromPosition)
if isMonster(cid) == 1 then
efect = 40
doRemoveCreature(cid)
doSendMagicEffect(topos, efect)
end
return TRUE
end
 
Code:
function onStepIn(cid, item, position, fromPosition)
smokepos = {x=here, y=here, z=here, stackpos=253}
smoke = getThingfromPos(smokepos)
if isMonster(smoke) == 1 then
doRemoveCreature(smoke)
end
end
replace 'here' with your co-ords where the smoke field is.
 
Last edited by a moderator:
@Boy67

it dont work


cant be wichout this: smokepos = {x=here, y=here, z=here, stackpos=253} ? :/
 
Last edited:
Code:
function onStepIn(cid, item, pos, fromPosition)
    smoke = getThingfromPos(pos)
    if isMonster(smoke) == 1 then
        doRemoveCreature(smoke)
    end
end
 
Code:
function onStepIn(cid, item, pos, fromPosition)
    pos = getCreaturePosition(cid)
    smoke = getThingfromPos(pos)
    if isMonster(smoke) == 1 then
        doRemoveCreature(smoke)
    end
end
 
In movements.xml:

If you want to make it on ALL smoke fields:
Code:
<movevent event="StepIn" itemid="SMOKE_FIELD_ID" script="smokefield.lua"/>

If you want to make it on ONE smoke field:
Code:
<movevent event="StepIn" uniqueid="SMOKE_FIELD_[B]UNIQUE[/B]_[B]ID[/B]" script="smokefield.lua.lua" />

smokefield.lua:
Code:
function onStepIn(cid, item, position, fromPosition)
    creature = getThingfromPos(position)
    if isPlayer(creature.uid) == FALSE then
        doRemoveCreature(creature.uid)
    end
    return TRUE
end
 
Or simply:
PHP:
function onStepIn(cid, item, position, fromPosition)
    if isMonster(cid) == FALSE then
        doRemoveCreature(cid)
    end
    return TRUE
end

@up It's isMonster not isPlayer :p:p
 
[25/02/2008 15:32:54] Lua Script Error: [MoveEvents Interface]
[25/02/2008 15:32:54] data/movements/scripts/remove.lua:eek:nStepIn

[25/02/2008 15:32:54] data/movements/scripts/remove.lua:2: attempt to call global 'isMonster' (a nil value)

Now, I get this error... :/
 
[25/02/2008 16:14:03] Lua Script Error: [MoveEvents Interface]
[25/02/2008 16:14:03] data/movements/scripts/remove.lua:eek:nStepIn

[25/02/2008 16:14:03] luaDoRemoveCreature(). Creature not found

omg, stll errorrr
 
They f*cked my script ¬¬

The Forgotten Server do not have the isMonster function.

Try my original script, that will work.

Code:
function onStepIn(cid, item, position, fromPosition)
    creature = getThingfromPos(position)
    if isPlayer(creature.uid) == FALSE then
        doRemoveCreature(creature.uid)
    end
    return TRUE
end
 
Back
Top