• Please report every thread you think might be harmful or does not meet expectations or the link is offline, you will be refunded the credits you paid and the Thread Starter recieves a message to update his content, if its malicious we remove it and warn and eventualy the TS if it reoccurs.

ESX OkOk TalkToNpc (1 Viewer)

crose

Well-known member
Joined
Aug 21, 2021
Messages
209
Reaction score
383
Points
63
Credits
8,778
[PREVIEW]
Okok Talk to NPC

[How it works]

Informations:

The camera is automatically positioned and rotated according to the NPC’s position and rotation (basically you just need to set the NPC’s coordinate and heading);You can set up to 6 options/actions (it is possible and easy to add more if you want, just send me a message);The okokTextUI script can be disabled by simply setting Config.OkokTextUI = false on the config file;The animation time can be easily changed on the config file;The minimap is hidden by default when interacting with an NPC (possible to disable it on the config file).

In the config file you are able to set:

The NPC you want to spawn;The NPC name (that appears on the top of the interface);The NPC’s dialog message;The NPC coordinates and rotation;The interaction range (how close you have to be to interact with them);The options displayed on the interface and which event they trigger;The jobs allowed to interact with the NPC (possible to have no jobs, just leave it empty).

[Optimization]

This script is fully optimized.

Tested with 350 NPC’s:

Idle: 0.03-0.04ms;Near an NPC: 0.07 - 0.12ms.

Obviously you won’t have 350 NPC’s in your server, so the values will be lower.

[Config]

XML:
Config.Key = 38 -- [E] Key to open the interaction, check here the keys ID: https://docs.fivem.net/docs/game-references/controls/#controls Config.AutoCamPosition = true -- If true it'll set the camera position automatically Config.AutoCamRotation = true -- If true it'll set the camera rotation automatically Config.HideMinimap = true -- If true it'll hide the minimap when interacting with an NPC Config.UseOkokTextUI = true -- If true it'll use okokTextUI Config.CameraAnimationTime = 1000 -- Camera animation time: 1000 = 1 second Config.TalkToNPC = {     {         npc = 'u_m_y_abner',                                         -- Website too see peds name:         header = 'Employee of the',                                 -- Text over the name         name = 'Pacific Bank',                                         -- Text under the header         uiText = "Pacific Bank's Employee",                            -- Name shown on the notification when near the NPC         dialog = 'Hey, how can I help you?',                        -- Text showm on the message bubble         coordinates = vector3(254.17, 222.8, 105.3),                 -- coordinates of NPC         heading = 160.0,                                            -- Heading of NPC (needs decimals, 0.0 for example)         camOffset = vector3(0.0, 0.0, 0.0),                         -- Camera position relative to NPC     | (only works if Config.AutoCamPosition = false)         camRotation = vector3(0.0, 0.0, 0.0),                        -- Camera rotation                     | (only works if Config.AutoCamRotation = false)         interactionRange = 2.5,                                     -- From how far the player can interact with the NPC         options = {                                                    -- Options shown when interacting (Maximum 6 options per NPC)             {'Where is the toilet?', 'okokTalk:toilet', 'c'},        -- 'c' for client             {'How can I rob the bank?', 'okokTalk:rob', 'c'},        -- 's' for server (if you write something else it'll be server by default)             {"I want to access my safe.", 'okokTalk:safe', 'c'},             {"I want to make a new credit card.", 'okokTalk:card', 'c'},             {"I lost my credit card.", 'okokTalk:lost', 'c'},             {"Is Jennifer working?", 'okokTalk:jennifer', 'c'},         },         jobs = {                                                    -- Jobs that can interact with the NPC                      },     },     --[[     -- This is the template to create new NPCs     {         npc = "",         header = "",         name = "",         uiText = "",         dialog = "",         coordinates = vector3(0.0, 0.0, 0.0),         heading = 0.0,         camOffset = vector3(0.0, 0.0, 0.0),         camRotation = vector3(0.0, 0.0, 0.0),         interactionRange = 0,         options = {             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},         },         jobs = {    -- Example jobs             'police',             'ambulance',         },     },     ]]-- }

 

Attachments

  • 489a2e71caede3f465857a14828be883da2d1638.png
    489a2e71caede3f465857a14828be883da2d1638.png
    219.2 KB · Views: 144
  • cf6908190625f33a9678b97f35bdf066ca8f2d18.jpeg.jpg
    cf6908190625f33a9678b97f35bdf066ca8f2d18.jpeg.jpg
    97.1 KB · Views: 143
Last edited:

Ugene

Active member
Joined
Sep 19, 2021
Messages
77
Reaction score
20
Points
8
Credits
43
co
[PREVIEW]
Okok Talk to NPC

[How it works]

Informations:

The camera is automatically positioned and rotated according to the NPC’s position and rotation (basically you just need to set the NPC’s coordinate and heading);You can set up to 6 options/actions (it is possible and easy to add more if you want, just send me a message);The okokTextUI script can be disabled by simply setting Config.OkokTextUI = false on the config file;The animation time can be easily changed on the config file;The minimap is hidden by default when interacting with an NPC (possible to disable it on the config file).

In the config file you are able to set:

The NPC you want to spawn;The NPC name (that appears on the top of the interface);The NPC’s dialog message;The NPC coordinates and rotation;The interaction range (how close you have to be to interact with them);The options displayed on the interface and which event they trigger;The jobs allowed to interact with the NPC (possible to have no jobs, just leave it empty).

[Optimization]

This script is fully optimized.

Tested with 350 NPC’s:

Idle: 0.03-0.04ms;Near an NPC: 0.07 - 0.12ms.

Obviously you won’t have 350 NPC’s in your server, so the values will be lower.

[Config]

XML:
Config.Key = 38 -- [E] Key to open the interaction, check here the keys ID: https://docs.fivem.net/docs/game-references/controls/#controls Config.AutoCamPosition = true -- If true it'll set the camera position automatically Config.AutoCamRotation = true -- If true it'll set the camera rotation automatically Config.HideMinimap = true -- If true it'll hide the minimap when interacting with an NPC Config.UseOkokTextUI = true -- If true it'll use okokTextUI Config.CameraAnimationTime = 1000 -- Camera animation time: 1000 = 1 second Config.TalkToNPC = {     {         npc = 'u_m_y_abner',                                         -- Website too see peds name:         header = 'Employee of the',                                 -- Text over the name         name = 'Pacific Bank',                                         -- Text under the header         uiText = "Pacific Bank's Employee",                            -- Name shown on the notification when near the NPC         dialog = 'Hey, how can I help you?',                        -- Text showm on the message bubble         coordinates = vector3(254.17, 222.8, 105.3),                 -- coordinates of NPC         heading = 160.0,                                            -- Heading of NPC (needs decimals, 0.0 for example)         camOffset = vector3(0.0, 0.0, 0.0),                         -- Camera position relative to NPC     | (only works if Config.AutoCamPosition = false)         camRotation = vector3(0.0, 0.0, 0.0),                        -- Camera rotation                     | (only works if Config.AutoCamRotation = false)         interactionRange = 2.5,                                     -- From how far the player can interact with the NPC         options = {                                                    -- Options shown when interacting (Maximum 6 options per NPC)             {'Where is the toilet?', 'okokTalk:toilet', 'c'},        -- 'c' for client             {'How can I rob the bank?', 'okokTalk:rob', 'c'},        -- 's' for server (if you write something else it'll be server by default)             {"I want to access my safe.", 'okokTalk:safe', 'c'},             {"I want to make a new credit card.", 'okokTalk:card', 'c'},             {"I lost my credit card.", 'okokTalk:lost', 'c'},             {"Is Jennifer working?", 'okokTalk:jennifer', 'c'},         },         jobs = {                                                    -- Jobs that can interact with the NPC                      },     },     --[[     -- This is the template to create new NPCs     {         npc = "",         header = "",         name = "",         uiText = "",         dialog = "",         coordinates = vector3(0.0, 0.0, 0.0),         heading = 0.0,         camOffset = vector3(0.0, 0.0, 0.0),         camRotation = vector3(0.0, 0.0, 0.0),         interactionRange = 0,         options = {             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},         },         jobs = {    -- Example jobs             'police',             'ambulance',         },     },     ]]-- }

-=Stripped Content=-
ol
 

REIJJ

Moderator
Staff member
Joined
Oct 28, 2021
Messages
81
Reaction score
33
Points
18
Credits
1,820
[PREVIEW]
Okok Talk to NPC

[How it works]

Informations:

The camera is automatically positioned and rotated according to the NPC’s position and rotation (basically you just need to set the NPC’s coordinate and heading);You can set up to 6 options/actions (it is possible and easy to add more if you want, just send me a message);The okokTextUI script can be disabled by simply setting Config.OkokTextUI = false on the config file;The animation time can be easily changed on the config file;The minimap is hidden by default when interacting with an NPC (possible to disable it on the config file).

In the config file you are able to set:

The NPC you want to spawn;The NPC name (that appears on the top of the interface);The NPC’s dialog message;The NPC coordinates and rotation;The interaction range (how close you have to be to interact with them);The options displayed on the interface and which event they trigger;The jobs allowed to interact with the NPC (possible to have no jobs, just leave it empty).

[Optimization]

This script is fully optimized.

Tested with 350 NPC’s:

Idle: 0.03-0.04ms;Near an NPC: 0.07 - 0.12ms.

Obviously you won’t have 350 NPC’s in your server, so the values will be lower.

[Config]

XML:
Config.Key = 38 -- [E] Key to open the interaction, check here the keys ID: https://docs.fivem.net/docs/game-references/controls/#controls Config.AutoCamPosition = true -- If true it'll set the camera position automatically Config.AutoCamRotation = true -- If true it'll set the camera rotation automatically Config.HideMinimap = true -- If true it'll hide the minimap when interacting with an NPC Config.UseOkokTextUI = true -- If true it'll use okokTextUI Config.CameraAnimationTime = 1000 -- Camera animation time: 1000 = 1 second Config.TalkToNPC = {     {         npc = 'u_m_y_abner',                                         -- Website too see peds name:         header = 'Employee of the',                                 -- Text over the name         name = 'Pacific Bank',                                         -- Text under the header         uiText = "Pacific Bank's Employee",                            -- Name shown on the notification when near the NPC         dialog = 'Hey, how can I help you?',                        -- Text showm on the message bubble         coordinates = vector3(254.17, 222.8, 105.3),                 -- coordinates of NPC         heading = 160.0,                                            -- Heading of NPC (needs decimals, 0.0 for example)         camOffset = vector3(0.0, 0.0, 0.0),                         -- Camera position relative to NPC     | (only works if Config.AutoCamPosition = false)         camRotation = vector3(0.0, 0.0, 0.0),                        -- Camera rotation                     | (only works if Config.AutoCamRotation = false)         interactionRange = 2.5,                                     -- From how far the player can interact with the NPC         options = {                                                    -- Options shown when interacting (Maximum 6 options per NPC)             {'Where is the toilet?', 'okokTalk:toilet', 'c'},        -- 'c' for client             {'How can I rob the bank?', 'okokTalk:rob', 'c'},        -- 's' for server (if you write something else it'll be server by default)             {"I want to access my safe.", 'okokTalk:safe', 'c'},             {"I want to make a new credit card.", 'okokTalk:card', 'c'},             {"I lost my credit card.", 'okokTalk:lost', 'c'},             {"Is Jennifer working?", 'okokTalk:jennifer', 'c'},         },         jobs = {                                                    -- Jobs that can interact with the NPC                      },     },     --[[     -- This is the template to create new NPCs     {         npc = "",         header = "",         name = "",         uiText = "",         dialog = "",         coordinates = vector3(0.0, 0.0, 0.0),         heading = 0.0,         camOffset = vector3(0.0, 0.0, 0.0),         camRotation = vector3(0.0, 0.0, 0.0),         interactionRange = 0,         options = {             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},         },         jobs = {    -- Example jobs             'police',             'ambulance',         },     },     ]]-- }

-=Stripped Content=-
 

hanspouw21

Well-known member
God VIP
Joined
Mar 2, 2021
Messages
261
Reaction score
25
Points
18
Age
48
Credits
825
[PREVIEW]
Okok Talk to NPC

[How it works]

Informations:

The camera is automatically positioned and rotated according to the NPC’s position and rotation (basically you just need to set the NPC’s coordinate and heading);You can set up to 6 options/actions (it is possible and easy to add more if you want, just send me a message);The okokTextUI script can be disabled by simply setting Config.OkokTextUI = false on the config file;The animation time can be easily changed on the config file;The minimap is hidden by default when interacting with an NPC (possible to disable it on the config file).

In the config file you are able to set:

The NPC you want to spawn;The NPC name (that appears on the top of the interface);The NPC’s dialog message;The NPC coordinates and rotation;The interaction range (how close you have to be to interact with them);The options displayed on the interface and which event they trigger;The jobs allowed to interact with the NPC (possible to have no jobs, just leave it empty).

[Optimization]

This script is fully optimized.

Tested with 350 NPC’s:

Idle: 0.03-0.04ms;Near an NPC: 0.07 - 0.12ms.

Obviously you won’t have 350 NPC’s in your server, so the values will be lower.

[Config]

XML:
Config.Key = 38 -- [E] Key to open the interaction, check here the keys ID: https://docs.fivem.net/docs/game-references/controls/#controls Config.AutoCamPosition = true -- If true it'll set the camera position automatically Config.AutoCamRotation = true -- If true it'll set the camera rotation automatically Config.HideMinimap = true -- If true it'll hide the minimap when interacting with an NPC Config.UseOkokTextUI = true -- If true it'll use okokTextUI Config.CameraAnimationTime = 1000 -- Camera animation time: 1000 = 1 second Config.TalkToNPC = {     {         npc = 'u_m_y_abner',                                         -- Website too see peds name:         header = 'Employee of the',                                 -- Text over the name         name = 'Pacific Bank',                                         -- Text under the header         uiText = "Pacific Bank's Employee",                            -- Name shown on the notification when near the NPC         dialog = 'Hey, how can I help you?',                        -- Text showm on the message bubble         coordinates = vector3(254.17, 222.8, 105.3),                 -- coordinates of NPC         heading = 160.0,                                            -- Heading of NPC (needs decimals, 0.0 for example)         camOffset = vector3(0.0, 0.0, 0.0),                         -- Camera position relative to NPC     | (only works if Config.AutoCamPosition = false)         camRotation = vector3(0.0, 0.0, 0.0),                        -- Camera rotation                     | (only works if Config.AutoCamRotation = false)         interactionRange = 2.5,                                     -- From how far the player can interact with the NPC         options = {                                                    -- Options shown when interacting (Maximum 6 options per NPC)             {'Where is the toilet?', 'okokTalk:toilet', 'c'},        -- 'c' for client             {'How can I rob the bank?', 'okokTalk:rob', 'c'},        -- 's' for server (if you write something else it'll be server by default)             {"I want to access my safe.", 'okokTalk:safe', 'c'},             {"I want to make a new credit card.", 'okokTalk:card', 'c'},             {"I lost my credit card.", 'okokTalk:lost', 'c'},             {"Is Jennifer working?", 'okokTalk:jennifer', 'c'},         },         jobs = {                                                    -- Jobs that can interact with the NPC                      },     },     --[[     -- This is the template to create new NPCs     {         npc = "",         header = "",         name = "",         uiText = "",         dialog = "",         coordinates = vector3(0.0, 0.0, 0.0),         heading = 0.0,         camOffset = vector3(0.0, 0.0, 0.0),         camRotation = vector3(0.0, 0.0, 0.0),         interactionRange = 0,         options = {             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},         },         jobs = {    -- Example jobs             'police',             'ambulance',         },     },     ]]-- }

-=Stripped Content=-
nice
 

AprendiiZRx

Active member
Joined
Feb 11, 2022
Messages
115
Reaction score
8
Points
18
Age
22
Location
Brazil
Credits
7
[PREVIEW]
Okok Talk to NPC

[How it works]

Informations:

The camera is automatically positioned and rotated according to the NPC’s position and rotation (basically you just need to set the NPC’s coordinate and heading);You can set up to 6 options/actions (it is possible and easy to add more if you want, just send me a message);The okokTextUI script can be disabled by simply setting Config.OkokTextUI = false on the config file;The animation time can be easily changed on the config file;The minimap is hidden by default when interacting with an NPC (possible to disable it on the config file).

In the config file you are able to set:

The NPC you want to spawn;The NPC name (that appears on the top of the interface);The NPC’s dialog message;The NPC coordinates and rotation;The interaction range (how close you have to be to interact with them);The options displayed on the interface and which event they trigger;The jobs allowed to interact with the NPC (possible to have no jobs, just leave it empty).

[Optimization]

This script is fully optimized.

Tested with 350 NPC’s:

Idle: 0.03-0.04ms;Near an NPC: 0.07 - 0.12ms.

Obviously you won’t have 350 NPC’s in your server, so the values will be lower.

[Config]

XML:
Config.Key = 38 -- [E] Key to open the interaction, check here the keys ID: https://docs.fivem.net/docs/game-references/controls/#controls Config.AutoCamPosition = true -- If true it'll set the camera position automatically Config.AutoCamRotation = true -- If true it'll set the camera rotation automatically Config.HideMinimap = true -- If true it'll hide the minimap when interacting with an NPC Config.UseOkokTextUI = true -- If true it'll use okokTextUI Config.CameraAnimationTime = 1000 -- Camera animation time: 1000 = 1 second Config.TalkToNPC = {     {         npc = 'u_m_y_abner',                                         -- Website too see peds name:         header = 'Employee of the',                                 -- Text over the name         name = 'Pacific Bank',                                         -- Text under the header         uiText = "Pacific Bank's Employee",                            -- Name shown on the notification when near the NPC         dialog = 'Hey, how can I help you?',                        -- Text showm on the message bubble         coordinates = vector3(254.17, 222.8, 105.3),                 -- coordinates of NPC         heading = 160.0,                                            -- Heading of NPC (needs decimals, 0.0 for example)         camOffset = vector3(0.0, 0.0, 0.0),                         -- Camera position relative to NPC     | (only works if Config.AutoCamPosition = false)         camRotation = vector3(0.0, 0.0, 0.0),                        -- Camera rotation                     | (only works if Config.AutoCamRotation = false)         interactionRange = 2.5,                                     -- From how far the player can interact with the NPC         options = {                                                    -- Options shown when interacting (Maximum 6 options per NPC)             {'Where is the toilet?', 'okokTalk:toilet', 'c'},        -- 'c' for client             {'How can I rob the bank?', 'okokTalk:rob', 'c'},        -- 's' for server (if you write something else it'll be server by default)             {"I want to access my safe.", 'okokTalk:safe', 'c'},             {"I want to make a new credit card.", 'okokTalk:card', 'c'},             {"I lost my credit card.", 'okokTalk:lost', 'c'},             {"Is Jennifer working?", 'okokTalk:jennifer', 'c'},         },         jobs = {                                                    -- Jobs that can interact with the NPC                      },     },     --[[     -- This is the template to create new NPCs     {         npc = "",         header = "",         name = "",         uiText = "",         dialog = "",         coordinates = vector3(0.0, 0.0, 0.0),         heading = 0.0,         camOffset = vector3(0.0, 0.0, 0.0),         camRotation = vector3(0.0, 0.0, 0.0),         interactionRange = 0,         options = {             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},         },         jobs = {    -- Example jobs             'police',             'ambulance',         },     },     ]]-- }

-=Stripped Content=-
ty
 

javimer89

New member
Joined
Feb 16, 2022
Messages
4
Reaction score
1
Points
3
Credits
0
[PREVIEW]
Okok Talk to NPC

[How it works]

Informations:

The camera is automatically positioned and rotated according to the NPC’s position and rotation (basically you just need to set the NPC’s coordinate and heading);You can set up to 6 options/actions (it is possible and easy to add more if you want, just send me a message);The okokTextUI script can be disabled by simply setting Config.OkokTextUI = false on the config file;The animation time can be easily changed on the config file;The minimap is hidden by default when interacting with an NPC (possible to disable it on the config file).

In the config file you are able to set:

The NPC you want to spawn;The NPC name (that appears on the top of the interface);The NPC’s dialog message;The NPC coordinates and rotation;The interaction range (how close you have to be to interact with them);The options displayed on the interface and which event they trigger;The jobs allowed to interact with the NPC (possible to have no jobs, just leave it empty).

[Optimization]

This script is fully optimized.

Tested with 350 NPC’s:

Idle: 0.03-0.04ms;Near an NPC: 0.07 - 0.12ms.

Obviously you won’t have 350 NPC’s in your server, so the values will be lower.

[Config]

XML:
Config.Key = 38 -- [E] Key to open the interaction, check here the keys ID: https://docs.fivem.net/docs/game-references/controls/#controls Config.AutoCamPosition = true -- If true it'll set the camera position automatically Config.AutoCamRotation = true -- If true it'll set the camera rotation automatically Config.HideMinimap = true -- If true it'll hide the minimap when interacting with an NPC Config.UseOkokTextUI = true -- If true it'll use okokTextUI Config.CameraAnimationTime = 1000 -- Camera animation time: 1000 = 1 second Config.TalkToNPC = {     {         npc = 'u_m_y_abner',                                         -- Website too see peds name:         header = 'Employee of the',                                 -- Text over the name         name = 'Pacific Bank',                                         -- Text under the header         uiText = "Pacific Bank's Employee",                            -- Name shown on the notification when near the NPC         dialog = 'Hey, how can I help you?',                        -- Text showm on the message bubble         coordinates = vector3(254.17, 222.8, 105.3),                 -- coordinates of NPC         heading = 160.0,                                            -- Heading of NPC (needs decimals, 0.0 for example)         camOffset = vector3(0.0, 0.0, 0.0),                         -- Camera position relative to NPC     | (only works if Config.AutoCamPosition = false)         camRotation = vector3(0.0, 0.0, 0.0),                        -- Camera rotation                     | (only works if Config.AutoCamRotation = false)         interactionRange = 2.5,                                     -- From how far the player can interact with the NPC         options = {                                                    -- Options shown when interacting (Maximum 6 options per NPC)             {'Where is the toilet?', 'okokTalk:toilet', 'c'},        -- 'c' for client             {'How can I rob the bank?', 'okokTalk:rob', 'c'},        -- 's' for server (if you write something else it'll be server by default)             {"I want to access my safe.", 'okokTalk:safe', 'c'},             {"I want to make a new credit card.", 'okokTalk:card', 'c'},             {"I lost my credit card.", 'okokTalk:lost', 'c'},             {"Is Jennifer working?", 'okokTalk:jennifer', 'c'},         },         jobs = {                                                    -- Jobs that can interact with the NPC                      },     },     --[[     -- This is the template to create new NPCs     {         npc = "",         header = "",         name = "",         uiText = "",         dialog = "",         coordinates = vector3(0.0, 0.0, 0.0),         heading = 0.0,         camOffset = vector3(0.0, 0.0, 0.0),         camRotation = vector3(0.0, 0.0, 0.0),         interactionRange = 0,         options = {             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},         },         jobs = {    -- Example jobs             'police',             'ambulance',         },     },     ]]-- }

-=Stripped Content=-
Nice
 

javimer89

New member
Joined
Feb 16, 2022
Messages
4
Reaction score
1
Points
3
Credits
0
[PREVIEW]
Okok Talk to NPC

[How it works]

Informations:

The camera is automatically positioned and rotated according to the NPC’s position and rotation (basically you just need to set the NPC’s coordinate and heading);You can set up to 6 options/actions (it is possible and easy to add more if you want, just send me a message);The okokTextUI script can be disabled by simply setting Config.OkokTextUI = false on the config file;The animation time can be easily changed on the config file;The minimap is hidden by default when interacting with an NPC (possible to disable it on the config file).

In the config file you are able to set:

The NPC you want to spawn;The NPC name (that appears on the top of the interface);The NPC’s dialog message;The NPC coordinates and rotation;The interaction range (how close you have to be to interact with them);The options displayed on the interface and which event they trigger;The jobs allowed to interact with the NPC (possible to have no jobs, just leave it empty).

[Optimization]

This script is fully optimized.

Tested with 350 NPC’s:

Idle: 0.03-0.04ms;Near an NPC: 0.07 - 0.12ms.

Obviously you won’t have 350 NPC’s in your server, so the values will be lower.

[Config]

XML:
Config.Key = 38 -- [E] Key to open the interaction, check here the keys ID: https://docs.fivem.net/docs/game-references/controls/#controls Config.AutoCamPosition = true -- If true it'll set the camera position automatically Config.AutoCamRotation = true -- If true it'll set the camera rotation automatically Config.HideMinimap = true -- If true it'll hide the minimap when interacting with an NPC Config.UseOkokTextUI = true -- If true it'll use okokTextUI Config.CameraAnimationTime = 1000 -- Camera animation time: 1000 = 1 second Config.TalkToNPC = {     {         npc = 'u_m_y_abner',                                         -- Website too see peds name:         header = 'Employee of the',                                 -- Text over the name         name = 'Pacific Bank',                                         -- Text under the header         uiText = "Pacific Bank's Employee",                            -- Name shown on the notification when near the NPC         dialog = 'Hey, how can I help you?',                        -- Text showm on the message bubble         coordinates = vector3(254.17, 222.8, 105.3),                 -- coordinates of NPC         heading = 160.0,                                            -- Heading of NPC (needs decimals, 0.0 for example)         camOffset = vector3(0.0, 0.0, 0.0),                         -- Camera position relative to NPC     | (only works if Config.AutoCamPosition = false)         camRotation = vector3(0.0, 0.0, 0.0),                        -- Camera rotation                     | (only works if Config.AutoCamRotation = false)         interactionRange = 2.5,                                     -- From how far the player can interact with the NPC         options = {                                                    -- Options shown when interacting (Maximum 6 options per NPC)             {'Where is the toilet?', 'okokTalk:toilet', 'c'},        -- 'c' for client             {'How can I rob the bank?', 'okokTalk:rob', 'c'},        -- 's' for server (if you write something else it'll be server by default)             {"I want to access my safe.", 'okokTalk:safe', 'c'},             {"I want to make a new credit card.", 'okokTalk:card', 'c'},             {"I lost my credit card.", 'okokTalk:lost', 'c'},             {"Is Jennifer working?", 'okokTalk:jennifer', 'c'},         },         jobs = {                                                    -- Jobs that can interact with the NPC                      },     },     --[[     -- This is the template to create new NPCs     {         npc = "",         header = "",         name = "",         uiText = "",         dialog = "",         coordinates = vector3(0.0, 0.0, 0.0),         heading = 0.0,         camOffset = vector3(0.0, 0.0, 0.0),         camRotation = vector3(0.0, 0.0, 0.0),         interactionRange = 0,         options = {             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'client:event', 'c'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},             {"", 'server:event', 's'},         },         jobs = {    -- Example jobs             'police',             'ambulance',         },     },     ]]-- }

-=Stripped Content=-
Nice
 

Users who are viewing this thread

Top