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

Solved Doors.lua

GOD Fito

Member
Joined
Oct 3, 2008
Messages
97
Solutions
1
Reaction score
9
Hi OTLand, i'm having problems with this script and i hope you guys can help me.

3wzP9L8.jpg


This is my problem, if there is a magic wall in front of the door and you want to stack in the door, you can't because the magic wall is there.

So i want to change that, i mean if the magic wall is there and the player want stack in the door, the simple way to do that is removing the magic wall at the moment you do right click in the door but i dont know how do that, if anyone can do it for me i would be greatful.

This is the full script http://pastebin.com/jWkqwXNp

TFS 0.3.7_SVN
 
Last edited:
This is the part that is preventing you from stacking on a magic wall I think (can't test, don't have that version).
Code:
local query = doTileQueryAdd(doorCreature.uid, toPosition, 20) -- allow to stack outside doors, but not on teleports or floor changing tiles
if(query == RETURNVALUE_NOTPOSSIBLE) then
        toPosition.x = toPosition.x - 1
        toPosition.y = toPosition.y + 1
        query = doTileQueryAdd(doorCreature.uid, toPosition, 20) -- repeat until found
end

if(query ~= RETURNVALUE_NOERROR) then
        doPlayerSendDefaultCancel(cid, query)
        return true
end

To fix it just remove that shit or add a check to see if there is an mwall on toPosition. Also if you opt to just remove it, it might be a good idea to add some pz checks otherwise players will be able to push themselves into pz by using the door if said door is placed in a retarded way.

If you do remove it, what should happen is it will push a player on top of the mwall and (at least in 0.4) if a player is pushed on top of an mwall, it will automatically remove said mwall. You can test this by simply pushing your GM character on top of the mwall. If your character moves onto it and the mwall dissapears then it works, if your character walks on top of the mwall and stands inside of it, then you will have to add some code to check if there is an mwall at toPosition, if mwall found, remove it, then continue.

Sorry I could not be of more help, I do not plan on compiling that version of TFS just to test a door script.
 
Back
Top