• 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!

function onStepIn

Gubailovo

Well-Known Member
Joined
Dec 19, 2013
Messages
407
Solutions
2
Reaction score
62
how do i add a function onStepIn?
I don't have it on the server, so I use function onWalkIn.
but for the teleport it does not work correctly
or I am using the wrong script
Lua:
function onWalkIn(cid, item, frompos, item2, topos)

playerpos = getPlayerPosition(cid)
novapos = {x=4016, y=3912, z=7}

if item.uid == 1137 then

getThingfromPos(playerpos)
doSendMagicEffect(playerpos,2)
doTeleportThing(cid,novapos)
doSendMagicEffect(novapos,10)
end
end


thank you in advance
 
Solution
I do not need the launch of the raid. I'm only interested in the teleport
You're the one that said...
How are you wanting the script to work?
when I step on a tile, a raid is launched according to the character level in a certain position.

Be more precise in your questions.

Anyway, it's a simple fix.
Just replace all those lines with teleport player.

Lua:
local certain_position = {x = 4016, y = 3912, z = 7}

function onWalkIn(cid, item, pos)

    local character_in_certain_position = getThingfromPos(certain_position) 
    
    if not isPlayer(character_in_certain_position.uid) then
        return true
    end
    
    local level = getPlayerLevel(character_in_certain_position.uid)
    
    if (level >= 8) and...
I have never heard of a server using onWalkIn, so this is a first.

What server are you using?
How is your movements.xml for this script setup? data/movements/movements.xml

How are you wanting the script to work?
 
I have never heard of a server using onWalkIn, so this is a first.

What server are you using?
How is your movements.xml for this script setup? data/movements/movements.xml

How are you wanting the script to work?
I do not use movements.xml
 
as an example. when I step on a tile, a raid is launched according to the character level in a certain position.
Lua:
function onWalkIn(cid, item, pos)
    if(getPlayerStorageValue(cid, 2005) == 1) then
        return 1
    end   
    
    level = getPlayerLevel(cid)
    
    if (level >= 8) and (level < 40) then
        doRaid('Quest48_raid_lvl8')
    elseif (level >= 40) and (level < 80) then
        doRaid('Quest48_raid_lvl40')
    elseif (level >= 80) and (level < 100) then
        doRaid('Quest48_raid_lvl80')
    elseif (level >= 100) and (level < 120) then
        doRaid('Quest48_raid_lvl100')   
    elseif (level >= 120) and (level < 140) then
        doRaid('Quest48_raid_lvl120')
    elseif (level >= 140) and (level < 180) then
        doRaid('Quest48_raid_lvl140')
    elseif (level >= 180) and (level < 220) then
        doRaid('Quest48_raid_lvl180')
    elseif (level >= 220) and (level < 260) then
        doRaid('Quest48_raid_lvl220')
    elseif (level >= 260) then
        doRaid('Quest48_raid_lvl260')
    end
    setPlayerStorageValue(cid, 2005, 1)

    return 1
end


I need the script to work as a teleport
Post automatically merged:

Didn't answer my other questions....
Thanks for that.

If you don't use movements.xml -> how do you register your tiles/items to use with your script?
\data\actions\actions.xml

Lua:
<action uniqueid="1136" script="castom/quest/quest48l.lua" />
 
as an example. when I step on a tile, a raid is launched according to the character level in a certain position.
Lua:
function onWalkIn(cid, item, pos)
    if(getPlayerStorageValue(cid, 2005) == 1) then
        return 1
    end  
   
    level = getPlayerLevel(cid)
   
    if (level >= 8) and (level < 40) then
        doRaid('Quest48_raid_lvl8')
    elseif (level >= 40) and (level < 80) then
        doRaid('Quest48_raid_lvl40')
    elseif (level >= 80) and (level < 100) then
        doRaid('Quest48_raid_lvl80')
    elseif (level >= 100) and (level < 120) then
        doRaid('Quest48_raid_lvl100')  
    elseif (level >= 120) and (level < 140) then
        doRaid('Quest48_raid_lvl120')
    elseif (level >= 140) and (level < 180) then
        doRaid('Quest48_raid_lvl140')
    elseif (level >= 180) and (level < 220) then
        doRaid('Quest48_raid_lvl180')
    elseif (level >= 220) and (level < 260) then
        doRaid('Quest48_raid_lvl220')
    elseif (level >= 260) then
        doRaid('Quest48_raid_lvl260')
    end
    setPlayerStorageValue(cid, 2005, 1)

    return 1
end


I need the script to work as a teleport
Post automatically merged:


\data\actions\actions.xml

Lua:
<action uniqueid="1136" script="castom/quest/quest48l.lua" />
I guess, like this?

Lua:
local certain_position = {x = 4016, y = 3912, z = 7}

function onWalkIn(cid, item, pos)

    local character_in_certain_position = getThingfromPos(certain_position) 
    
    if not isPlayer(character_in_certain_position.uid) then
        return true
    end
    
    local level = getPlayerLevel(character_in_certain_position.uid)
    
    if (level >= 8) and (level < 40) then
        doRaid('Quest48_raid_lvl8')
    elseif (level >= 40) and (level < 80) then
        doRaid('Quest48_raid_lvl40')
    elseif (level >= 80) and (level < 100) then
        doRaid('Quest48_raid_lvl80')
    elseif (level >= 100) and (level < 120) then
        doRaid('Quest48_raid_lvl100')   
    elseif (level >= 120) and (level < 140) then
        doRaid('Quest48_raid_lvl120')
    elseif (level >= 140) and (level < 180) then
        doRaid('Quest48_raid_lvl140')
    elseif (level >= 180) and (level < 220) then
        doRaid('Quest48_raid_lvl180')
    elseif (level >= 220) and (level < 260) then
        doRaid('Quest48_raid_lvl220')
    elseif (level >= 260) then
        doRaid('Quest48_raid_lvl260')
    end

    return true
end
 
I guess, like this?

Lua:
local certain_position = {x = 4016, y = 3912, z = 7}

function onWalkIn(cid, item, pos)

    local character_in_certain_position = getThingfromPos(certain_position)
   
    if not isPlayer(character_in_certain_position.uid) then
        return true
    end
   
    local level = getPlayerLevel(character_in_certain_position.uid)
   
    if (level >= 8) and (level < 40) then
        doRaid('Quest48_raid_lvl8')
    elseif (level >= 40) and (level < 80) then
        doRaid('Quest48_raid_lvl40')
    elseif (level >= 80) and (level < 100) then
        doRaid('Quest48_raid_lvl80')
    elseif (level >= 100) and (level < 120) then
        doRaid('Quest48_raid_lvl100')  
    elseif (level >= 120) and (level < 140) then
        doRaid('Quest48_raid_lvl120')
    elseif (level >= 140) and (level < 180) then
        doRaid('Quest48_raid_lvl140')
    elseif (level >= 180) and (level < 220) then
        doRaid('Quest48_raid_lvl180')
    elseif (level >= 220) and (level < 260) then
        doRaid('Quest48_raid_lvl220')
    elseif (level >= 260) then
        doRaid('Quest48_raid_lvl260')
    end

    return true
end
I do not need the launch of the raid. I'm only interested in the teleport
 
I do not need the launch of the raid. I'm only interested in the teleport
You're the one that said...
How are you wanting the script to work?
when I step on a tile, a raid is launched according to the character level in a certain position.

Be more precise in your questions.

Anyway, it's a simple fix.
Just replace all those lines with teleport player.

Lua:
local certain_position = {x = 4016, y = 3912, z = 7}

function onWalkIn(cid, item, pos)

    local character_in_certain_position = getThingfromPos(certain_position) 
    
    if not isPlayer(character_in_certain_position.uid) then
        return true
    end
    
    local level = getPlayerLevel(character_in_certain_position.uid)
    
    if (level >= 8) and (level < 40) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
        
    elseif (level >= 40) and (level < 80) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
        
    elseif (level >= 80) and (level < 100) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
        
    elseif (level >= 100) and (level < 120) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7}) 
        
    elseif (level >= 120) and (level < 140) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
        
    elseif (level >= 140) and (level < 180) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
        
    elseif (level >= 180) and (level < 220) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
        
    elseif (level >= 220) and (level < 260) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
        
    elseif (level >= 260) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
    end

    return true
end
 
Solution
You're the one that said...



Be more precise in your questions.

Anyway, it's a simple fix.
Just replace all those lines with teleport player.

Lua:
local certain_position = {x = 4016, y = 3912, z = 7}

function onWalkIn(cid, item, pos)

    local character_in_certain_position = getThingfromPos(certain_position)
   
    if not isPlayer(character_in_certain_position.uid) then
        return true
    end
   
    local level = getPlayerLevel(character_in_certain_position.uid)
   
    if (level >= 8) and (level < 40) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
       
    elseif (level >= 40) and (level < 80) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
       
    elseif (level >= 80) and (level < 100) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
       
    elseif (level >= 100) and (level < 120) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
       
    elseif (level >= 120) and (level < 140) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
       
    elseif (level >= 140) and (level < 180) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
       
    elseif (level >= 180) and (level < 220) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
       
    elseif (level >= 220) and (level < 260) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
       
    elseif (level >= 260) then
        doTeleportThing(cid, {x = 1000, y = 1000, z = 7})
    end

    return true
end
it doesn't work, but thanks anyway for the quick answer. Some functions arvographically differ on my server.

My script worked correctly. I just went beyond the border of the map
thanks for the answer
 
Back
Top