Player

Holds some helpful player functions.

Summary
PlayerHolds some helpful player functions.
Tables
slapSoundsThese are the sounds used for slaps.
Functions
slapSlaps an entity, can be a user or any entity.
kickKicks a user.
invisibleMakes a user invisible
getSpawnInfoGrabs and returns player information that can be used to respawn player with same health/armor as before the spawn.
spawnEnhanced spawn player.

Tables

slapSounds

These are the sounds used for slaps.

Functions

slap

function ULib.slap(ent,
damage,
power,
nosound)

Slaps an entity, can be a user or any entity.

Parameters

entThe target ent.
damage(Optional, defaults to 0) The amount of damage to inflict on the entity.
power(Optional, defaults to 30) The power of the slap.
nosound(Optional, defaults to false) If true, no sound will be played.

kick

function ULib.kick(ply,
reason,
calling_ply)

Kicks a user.

Parameters

plyThe player to kick.
reason(Optional) The reason to give for kicking.
calling_ply(Optional) The player doing the kicking.

Revisions

v2.60Fixed a bug with the parameters if you didn’t pass reason and calling_ply together.

invisible

function ULib.invisible(ply,
bool,
visibility)

Makes a user invisible

Parameters

plyThe player to affect.
boolWhether they’re invisible or not
visibility(Optional, defaults to 0) A number from 0 to 255 for their visibility.

Revisions

v2.40Removes shadow when invisible

getSpawnInfo

function ULib.getSpawnInfo(ply)

Grabs and returns player information that can be used to respawn player with same health/armor as before the spawn.

Parameters

plyThe player to grab information for.

Returns

Updates player object to store health and armor.  Has no effect unless ULib.Spawn is used later.

spawn

function ULib.spawn(player,
bool)

Enhanced spawn player.  Can spawn player and return health/armor to status before the spawn.  (Only IF ULib.getSpawnInfo was used previously.)  Clears previously set values that were stored from ULib.getSpawnInfo.

Parameters

plyThe player to grab information for.
boolIf true, spawn will set player information to values stored using ULib.SpawnInfo

Returns

Spawns player.  Sets health/armor to stored defaults if ULib.getSpawnInfo was used previously.  Clears SpawnInfo table afterwards.

function ULib.slap(ent,
damage,
power,
nosound)
Slaps an entity, can be a user or any entity.
function ULib.kick(ply,
reason,
calling_ply)
Kicks a user.
function ULib.invisible(ply,
bool,
visibility)
Makes a user invisible
function ULib.getSpawnInfo(ply)
Grabs and returns player information that can be used to respawn player with same health/armor as before the spawn.
function ULib.spawn(player,
bool)
Enhanced spawn player.
Close