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

[Movements] Pits of inferno.

Midxas

New Member
Joined
Apr 21, 2014
Messages
43
Reaction score
0
Hello im trying to configurate my poi scripts but im totally newbie in this and i dont know what's wrong.

I put this in movements.xml
Code:
<movevent event="StepIn" uniqueid="10201" script="PitsOfInferno/MagicWallEntrance.lua" />
<movevent event="StepIn" uniqueid="10202" script="PitsOfInferno/MagicWallExit.lua" />

than in Pitsofinferno
Code:
function onStepIn(cid, item, frompos, item2, topos)
local playerPosition = getPlayerPosition(cid)
local newPosition = {x=1517, y=1442, z=9}
if item.uid == 10201 then
getThingfromPos(playerPosition)
doSendMagicEffect(playerPosition, 2)
doTeleportThing(cid, newPosition)
doSendMagicEffect(newPosition, 10)
end
return true
end

And on map at the ground when you have to step in to be teleport i put unique id.

And here is problem. When i step in on this ground nothing happen ;/ Anyone can help?
 
First of all, you need to tab your code cuz its disgusting.

Secondly, it is useful to know that (in case you are using 0.4 and maybe 0.3.6) the onStepIn movement has many more options you can use. Not needed for this script ofc, but it is useful to know that it exists in case you don't.

Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)

Third, getThingfromPos(playerPosition) doesn't seem to be used at all in the script so idk why its even there.

And last but not least, you do not need to make 2 different files to do what you want, you can put both in the same script.
This bit implies that you want to do such a thing but for some reason decided not to. There is no reason to check the unique id inside the script unless you are using the same file for multiple things.
Code:
if item.uid == 10201 then

Now to answer your question... Your script should work just fine, ensure that you have set the unique id of the tile to 10201 since that is what you have it set to in the movements.xml
To confirm that the script is registered properly you can always add print("test") at the start of the script and then step on the tile and in your server console it should say the word test each time you do.
Code:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
    print("TEST")
    return true
end

If it does say test, then maybe I am retarded and missread your script and there actually is something wrong. If it does not say test, then you have for sure misstyped something somewhere.
 
I tried and i wasn't work because of wrong commend in movment.xml. Thank dude for help with this TEST. It realised to me that script is fine but something else is wrong. peace
 
Back
Top