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

OTClient Prevent Player Movement

Nostalgian

Member
Joined
Mar 17, 2018
Messages
66
Reaction score
15
Hi all, been a while.

I have some custom windows in my server (OTC V8). I'm trying to accomplish one of two things:

1. When X window is open, player cannot move
2. When X window is open, and player moves, window closes (like with NPC trade windows)

The problem I'm trying to solve, is that I do not want the player to be able to click on a certain crafting station, bring up the window, and then walk to the depot with the window open and craft to their hearts content.

This seems like a really easy thing to do, and maybe it is..... but I have spent the past 6? hours on it, and I'm out of ideas haha.

I have searched through the NPC files to try and see how this is done there, no luck.
I have been trying an assortment of things with the walking scripts....... no luck.

This is 100% a "lack of skill" problem on my part, I'm sure of it. So, if one of you wizards would be so kind as to help me out here, I'd greatly appreciate it. I might even give you a virtual fist bump!
 
u only need add a lock and unlock when your window appear or close/hide. To do this you just have to add the lock right after the window is displayed like:

CraftWindow:show()

you need add hust after something like

CraftWindow:lock()



and you should do the same but now to unlock it right after it is hidden or closed like this:


CraftWindow:hide()

CraftWindow:unlock()

Use it as an example and you will find a way.
 
Back
Top