11-11-2015, 01:01 AM
@DiamondToaster: You're using an inefficient way to do this. Reorganize your StopMove table to instead be a map of PlayerName -> true for all players that are to be stopped, then it's much better:
--- Map of PlayerName -> true for all players who should not be allowed to move StopMove = {} -- Stop a player from moving: StopMove[a_Player:GetName()] = true -- Enable player to move again: StopMove[a_Player:GetName()] = nil --- The hook handler for HOOK_PLAYER_MOVING, stops specified players from moving: function OnPlayerMoving(Player) if (StopMove[Player:GetName()]) then return true end end