Jump to content

Freeze player in place


Dr_Cox1911

Recommended Posts

Have tried to use the search function, but couldn´t find anything related to this and I´m kinda lost here.

 

How could I lock the player to the current position he/she is standing on? Need this for a MP mod, when all clients clicked the dialog they should be able to move again.

Link to comment
Share on other sites

local ISWalkToTimedAction_update_old = ISWalkToTimedAction.update;function ISWalkToTimedAction:update(...)    if instanceof(self.character, "IsoPlayer") and self.character:isBlockMovement() then        self:forceStop();        return;    end    return ISWalkToTimedAction_update_old(self, ...);endfunction freezePlayer()    getPlayer():setBlockMovement(true);    getPlayer():setPath(nil);endfunction unfreezePlayer()    getPlayer():setBlockMovement(false);end

Will work with right-click movement for most cases (they can still jump through windows if they're close enough though.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...