> For the complete documentation index, see [llms.txt](https://hrscripts.gitbook.io/hrscripts-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hrscripts.gitbook.io/hrscripts-documentation/resources/hrlib/modules/fplayer/shared.md).

# Shared

## Teleport

Function to teleport the focused player only with given coords

```lua
function FPlayer:Teleport(coords: vector3)
```

Parameters description

* `coords` - the coordinates to use when teleporting the player

## SpawnVehicle

Function to spawn a vehicle with specific vehicle model and the option to spawn the player inside the vehicle

```lua
function FPlayer:SpawnVehicle(
    vehModel: string|integer,
    spawnPlayerInside: boolean?,
    saveVehicle: boolean?
): integer vehicle
```

Parameters description

* `vehModel` - the vehicle model in string or hash format
* `spawnPlayerInside` - sets whether or not spawn the player in
* `saveVehicle` - sets whether or not save the vehicle, the player is currently in if it's in any vehicle

Return description

* `vehicle` - the entityId of the spawned vehicle

## SetHealth

Function to set the health of the focused player

```lua
function FPlayer:SetHealth(health: number?)
```

Parameters description

* `health` - the health to set (if nil, it will heal the player with the maximum health for its ped)

## SetInvincibility

Function to toggle focused player's invincibility

```lua
function FPlayer:SetInvincibility(toggle: boolean?)
```

Parameters description

* `toggle` - sets whether or not the player is invincible
