Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/cuhHub/Noir
Browse files Browse the repository at this point in the history
  • Loading branch information
Cuh4 committed Jun 15, 2024
2 parents d1e6062 + 7895799 commit 3017984
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions docs/api-reference/noir/built-ins/classes/playerclass.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

**Noir.Classes.PlayerClass**: `NoirClass`

A class that represents a player for the built-in PlayerService.
Represents a player.

***

```lua
Noir.Classes.PlayerClass:Init(name, ID, steam, admin, auth)
Noir.Classes.PlayerClass:Init(name, ID, steam, admin, auth, permissions)
```

Initializes player class objects.
Expand All @@ -19,34 +19,59 @@ Initializes player class objects.
* `steam`: string
* `admin`: boolean
* `auth`: boolean
* `permissions`: table\<string, boolean>

***

```lua
Noir.Classes.PlayerClass:_Serialize()
Noir.Classes.PlayerClass:SetPermission(permission)
```

**⚠️ | Deprecated. Do not use.**
Give this player a permission.

Serializes this player for g\_savedata.
#### Parameters

* `permission`: string

***

```lua
Noir.Classes.PlayerClass._Deserialize(serializedPlayer)
Noir.Classes.PlayerClass:HasPermission(permission)
```

**⚠️ | Deprecated. Do not use.**
Returns whether or not this player has a permission.

#### Parameters

* `permission`: string

Deserializes a player from g\_savedata into a player class object.
#### Returns

* `boolean`

***

```lua
Noir.Classes.PlayerClass:RemovePermission(permission)
```

Remove a permission from this player.

#### Parameters

* `serializedPlayer`: NoirSerializedPlayer
* `permission`: string

***

```lua
Noir.Classes.PlayerClass:GetPermissions()
```

Returns a table containing the player's permissions.

#### Returns

* `NoirPlayer`
* `table<integer, string>`

***

Expand Down

0 comments on commit 3017984

Please sign in to comment.