Player.Lock
From GMod Wiki
Function | |
Syntax | Player:Lock( ) |
Description: | |
Stops players from using any inputs, such as moving or firing | |
Returns: | nil |
In Object: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.Lock]Player.Lock [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | This example will lock all players. |
---|---|
Used on | |
Code | local players = player.GetAll() for _, player in pairs(players) do player:Lock() end |
Output | N/A |
Additional Notes
- Use Player.UnLock to unlock them.
- Compared to Player.Freeze, this makes them be locked after death, and keybindings is NOT called.
- Players Can still spawn, and undo props, as well as control things that have a numpad input.
- Note that calling this on player spawn could screw up the selected spawn position for your player, as he could be locked to his spectator position from before spawning.