• 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.
 
[25/02/2008 16:14:03] Lua Script Error: [MoveEvents Interface]
[25/02/2008 16:14:03] data/movements/scripts/remove.luanStepIn

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

but i get this error when I step on this field on my character...
 
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

I don't understand why you use
PHP:
creature = getThingfromPos(position)
When there is a cid. Rather use cid.
PHP:
function onStepIn(cid, item, position, fromPosition)
    if isPlayer(cid) == FALSE then
        doRemoveCreature(cid)
    end
    return TRUE
end
 
this would work if:
Code:
function onStepIn(cid, item, position, fromPosition)
    creature = getThingfromPos(position)
    if isPlayer(creature.uid) == FALSE then
        doRemoveCreature(creature)
    end
    return TRUE
end
@ knightmare: he used creature.uid on the Remove Creature function when it doesnt require a uid.

But colandus, yours is simpler.

If this script or Colandus' script doesnt work then ronaldino must be doing something wrong as these scripts are error free.
 
Code:
function onStepIn(cid, item, position, fromPosition)
    creature = getThingfromPos(position)
    if isPlayer(creature.uid) == 0 then
        doRemoveCreature(creature)
    end
    return TRUE
end
or
Code:
function onStepIn(cid, item, position, fromPosition)
    creature = getThingfromPos(position)
    if isPlayer(creature.uid) == 1 then
        doRemoveCreature(creature)
    end
    return TRUE
end
 
this would work if:
Code:
function onStepIn(cid, item, position, fromPosition)
    creature = getThingfromPos(position)
    if isPlayer(creature.uid) == FALSE then
        doRemoveCreature(creature)
    end
    return TRUE
end
@ knightmare: he used creature.uid on the Remove Creature function when it doesnt require a uid.

But colandus, yours is simpler.

If this script or Colandus' script doesnt work then ronaldino must be doing something wrong as these scripts are error free.

doRemoveCreature() requires uid.
 
You don't always need to test a script to see if it's working, I've done 10 times bigger scripts than that one without testing, bug free sometimes but not always. But I can always see the bugs... So, why would it be so hard to see wrong in such a little script?

What did you write in movements.xml?
 
I write that, what must be lol. It doesn't metter what I have in movements.xml, there must be only itemid= and script name.lua also tags ofc...

And yes, you need to test a script, why? Look how many people try to help me, and no one script working... If its little script, why this thread got 4 pages :D haha
 
Because you must have done something wrong. I'll test it now.

Edit:
TESTED AND WORKS PERFECTLY... Using the code I posted on page 3: http://otland.net/showpost.php?p=51021&postcount=24

Code:
PHP:
function onStepIn(cid, item, position, fromPosition) 
    if isPlayer(cid) == FALSE then 
        doRemoveCreature(cid) 
    end 
    return TRUE 
end

You think I'd do wrong on a 3 lines script without notice? -.-
 
Last edited:
4 pages for such a script, huh... Next time you request something, please tell us:

1. Which distro you use.
2. How you do.
3. What did you add in movements.xml?
 
Tell me what you added in movements.xml! Not "I add correct". It might be correct, but I don't wanna waste my time if that's what's wrong.
 
Back
Top