🖥️Functions
GetPlayerData
Function Description
This function will simply return the value of UgCore.PlayerData.
Function Example
Function Return
SetPlayerData
Function Description
This function will insert or replace a player data. This is useful to insert more data to the player for custom scripts.
Function Example
Function Arguments
Argument | Type | Required | Description |
---|---|---|---|
key | string | yes | Data that you want to insert or replace. |
value | string | yes | Value of the data you want to attribute. |
IsPlayerLoaded
Function Description
This function will basically return the state of the player. In this case, if he has loaded or not.
Function Example
Function Return
UgCore.PlayerLoaded - boolean
CreateProgressBar
Function Description
This function will use the ug-progressBar script and create a progress bar. It can be used for example when you are using items, reviving players or others. This supports callbacks and has animations too.
Function Example
Function Arguments
Argument | Type | Required | Description |
---|---|---|---|
name | string | yes | Name of the progressbar. |
label | string | yes | Label that will show in the progressbar. |
duration | number | yes | Duration of the progressbar in ms. |
useWhileDead | boolean | yes | If the player can use the progressbar while dead. |
canCancel | boolean | yes | If the player can cancel the progressbar. |
disableControls | table | yes | Table of the controls to disable when in the progressbar. |
animation | table | yes | Table of the animation that will be played. |
prop | table | yes | Table of the prop that the player will have. |
propTwo | table | yes | Table of the second prop that the player will have. |
onFinish | function | yes | Callback of when the progressbar is finished successfully. |
onCancel | function | yes | Callback of when the progressbar is cancelled. |
GetItem
Function Description
This function will get the player inventory and will simply search for a specified item.
Function Example
Function Arguments
Argument | Type | Required | Description |
---|---|---|---|
item | string/table | yes | Items to search for. |
amount | number | yes | Amount that will be searched. |
Notify
Function Description
This function will send a notification to the player. This function is responsible to make the notify event working.
Function Example
Function Arguments
Argument | Type | Required | Description |
---|---|---|---|
title | string | yes | Title that will show in the notification. |
description | string | yes | Message that will show in the notification. |
type | string | yes | Type of the notification. |
length | number | yes | Duration of the notification in ms. |
Notify
Function Description
This function will send a notification to the player. This function is responsible to make the notify event working.
Function Example
Function Arguments
Argument | Type | Required | Description |
---|---|---|---|
title | string | yes | Title that will show in the notification. |
description | string | yes | Message that will show in the notification. |
type | string | yes | Type of the notification. |
length | number | yes | Duration of the notification in ms. |
Last updated