Player.LagCompensation
From GMod Wiki
Function | |
Syntax | Player:LagCompensation( Boolean var ) |
Description: | |
Moves all the players back to the spots where they were when the player fired the gun (a ping time ago) | |
Returns: | nil |
In Object: | Player |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Player.LagCompensation]Player.LagCompensation [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Additional Notes
- You should only enable LagCompensation if the player is going to shoot. So do this in a weapon. Disable it after he shot, to keep prediction errors low.
- FireBullets has been thought to automatically perform lag compensation when it is called, while it actually does not. When it is used in a weapon, turn lag compensation on on the weapon's owner, call FireBullets, then turn lag compensation off.
- When using self.Owner:LagCompensation(true) or false in a SHARED.LUA file in a swep. Make sure it is written if SERVER then LAGCOMPENHERE end