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

Windows Reset Door Bug

juansanchez

Intermediate OT User
Joined
Apr 2, 2015
Messages
217
Reaction score
130
Hey otland guys, i need help today with my reset door script that i have.
In my server there is Reset System, and so i needed reset doors. I found the script in another forum and it kind of works.
Whoever did the script, added a function to give +1 id to the door in order to open.
And if the players keep on walking in and out in the door, the door starts to change to other doors, some doors go sideways and it all messes up.
I Tried to ask for help in the other forum but no one could help me, if anyone can help me out, i'd really appreciate.

Script:

function onUse(cid, item, frompos, item2, topos)
local reset = 5 -- quanty reset
if getPlayerReset(cid) < reset then
return doPlayerSendTextMessage(cid,18,"Voce precisa de "..reset.." resets ou mais para passar dessa porta.") end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, TRUE)
return true
end

TFS 0.3.7
 
You need a movement script for StepOut so when the player steps out of that door, it closes again. This should already exist unless it's a door in a version that isn't updated in your existing script. In movements, there should be a script already for walking out of doors. Find it and add the id of your door to it.
 
You need a movement script for StepOut so when the player steps out of that door, it closes again. This should already exist unless it's a door in a version that isn't updated in your existing script. In movements, there should be a script already for walking out of doors. Find it and add the id of your door to it.

I tried removing the function, but when i do so, the door doesn't open anymore, people go trough it, but it doens't open
 
Yes, because the function is what opens the door. You need to add the id of the door to the movement that handles door closing, as I stated above.
 
I'm telling you there's not because if there was, it would be setting the door back to its original id whenever a player steps out.
 
I'm telling you there's not because if there was, it would be setting the door back to its original id whenever a player steps out.

The door id i want to use is: 5122

<movevent type="StepOut" itemid="5122" event="script" value="closingdoor.lua"/>
<movevent type="StepIn" itemid="5122" event="script" value="walkback.lua"/>

One of the Id's there are many others...
The thing is, whenever i use the script the way it was made, if the players keep on walking into the door and out, it will eventually bug, and turn into a whole different door.
If i remove the function which changes the door id, the door won't even open, the player right clicks the door, he walks in the door, but it doens't open, it keeps itself closed, as if the player was stuck in a wall.
 
What does your actions.xml look like for this script

I have to create a tag with a different ID for each door i want to add resets, but basically:

<action actionid="42000" script="Portas de Reset/lagarto hunt.lua"/>
<action actionid="42001" script="Portas de Reset/lagarto quest.lua"/>
<action actionid="42002" script="Portas de Reset/anubis osiris.lua"/>
<action actionid="42003" script="Portas de Reset/abo mini cave.lua"/>
<action actionid="42004" script="Portas de Reset/abo ice.lua"/>
<action actionid="42005" script="Portas de Reset/dona paradise.lua"/>
<action actionid="42006" script="Portas de Reset/dona paradise.lua"/>
 
There's the problem. Try this one
Code:
function onUse(cid, item, frompos, item2, topos)
local reset = 5 -- quanty reset
if item.itemid ~= 5122 then
return true
end
if getPlayerReset(cid) < reset then
return doPlayerSendTextMessage(cid,18,"Voce precisa de "..reset.." resets ou mais para passar dessa porta.") end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, TRUE)
return true
end
Currently, the way the script works, is based solely on actionid. When the item is transformed to the open door, it still has the actionid, meaning using it again while standing on it will cause it to go to a different id and eventually the StepOut will stop working because it'll no longer be an id in the StepOut script
 
There's the problem. Try this one
Code:
function onUse(cid, item, frompos, item2, topos)
local reset = 5 -- quanty reset
if item.itemid ~= 5122 then
return true
end
if getPlayerReset(cid) < reset then
return doPlayerSendTextMessage(cid,18,"Voce precisa de "..reset.." resets ou mais para passar dessa porta.") end
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, topos, TRUE)
return true
end
Currently, the way the script works, is based solely on actionid. When the item is transformed to the open door, it still has the actionid, meaning using it again while standing on it will cause it to go to a different id and eventually the StepOut will stop working because it'll no longer be an id in the StepOut script

SO far so good, nothing wrong yet :) Thanks man
 
Back
Top