• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua How add more items script?

jackl90

Member
Joined
Jul 25, 2017
Messages
249
Reaction score
12
LUA:
function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end

    if item:getId() == 1487 then
        item:getPosition():sendMagicEffect(16)
    end
    
    return true
end
how can i add more items in this script? no only 1487 id

i need that this script work with 1487 or 1852 or 1933

thanks in advance
 
XML:
<movevent event="StepIn" itemid="1487" script="script.lua" />
<movevent event="StepIn" itemid="1852" script="script.lua" />
<movevent event="StepIn" itemid="1933" script="script.lua" />
 
If you want to execute exactly same thing for every item, yes.

yes i want exactly same thing for every item, but i did this and no work ;/

LUA:
function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() and creature:isInGhostMode() then
        item:getPosition():sendMagicEffect(16)
        return true
    end
end
 
yes i want exactly same thing for every item, but i did this and no work ;/

LUA:
function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() and creature:isInGhostMode() then
        item:getPosition():sendMagicEffect(16)
        return true
    end
end
XML and Lua parts are fine. Make sure that script name is correct. Maybe isInGhostMode is false?
 
LUA:
function onStepIn(creature, item, position, fromPosition)
    if creature:isPlayer() and creature:isInGhostMode() then
        return true
    end
    
    item:getPosition():sendMagicEffect(16)
    return true
end
 
Back
Top