This part is the part where an event trigger can be created when a message is triggered or called when entering a location.
1- When you enter a location send message#
Config.Locations = {
[vector3(1398.11, 3669.86, 33.35)] = {
message = "#121632*",
name = 'B***k M****',
isSended = false
}
}
You can add a new coordinate and message to the table as follows, you can also change the name of the messenger. isSended = true, if you do, the number will be registered and can be called, but it will not be shown in that laconation, so think of it as a hidden code.
Config.Locations = {
[vector3(1398.11, 3669.86, 33.35)] = {
message = "#121632*",
name = 'B***k M****',
isSended = false
},
[vector3(0, 0, 0)] = { -- coords
message = "#111111*", -- edit number & name
name = 'Example Example', -- like this
isSended = false
}
}
2- When call a number - trigger#
Config.Numbers = { -- You can add more numbers
{
number = '#111631*',
name = 'B***k M****',
haveVocal = '../tasks/blackmarket.wav',
action = function(tinfo)
Task.BlackMarketLocation(tinfo)
end
}...
As you can see, you can create a new table with similar logic to the other table.
| type | value | desc |
|---|---|---|
| number | string | The number at which the code is triggered. |
| name | string | Display name. |
| haveVocal | bool - string | if you have an audio file - if not you can set "false" |
| action | function | Triggerable part |
How it works?#
1- Create a new number
Config.Numbers = { -- You can add more numbers
{
number = '#111631*',
name = 'B***k M****',
haveVocal = '../tasks/blackmarket.wav',
action = function(tinfo)
Task.BlackMarketLocation(tinfo)
end
},
{
number = '#111111*', -- display number
name = 'Example', -- display name
haveVocal = '../tasks/example.wav', -- have vocal
action = function(tinfo)
Task.Example(tinfo) -- trigger
end
}
}
2- How it works trigger
Open the tasks/tasks.lua, and go all the way down. Create a new function.
It must have the same name as the trigger you will name above - like "Task.Example"
Task.Example = function(tinfo)
--- you can adapt your heist open door code or you can s
end
3- If you have vocal
You must enter the search entries as follows and if there is sound, you must set it this way.
Task.Example = function(tinfo)
UpdateCallInfo(tinfo.number, tinfo.name, 'Calling...') -- Updates call info
Wait(2000) -- waiting for ringing -- for realistism
UpdateCallInfo(tinfo.number, tinfo.name, 'In Call') -- Updates call info
if tinfo.haveVocal then
Task.Sound(tinfo.haveVocal) -- you need to use to play sounds
end
Wait(10000)
UpdateCallInfo(tinfo.number, tinfo.name, 'End Call') -- Updates
--- YOUR CODE HERE
exports["example-script"].exampleTrigger()
TriggerServerEvent("example-script:exampletrigger")
end
| value | type | desc |
|---|---|---|
| UpdateCallInfo | function | Allows you to update the call info without which the call cannot be set up and will give an error. |
| Wait | function | It's there to provide realism, you can use it at all if you want. Recommended for use. |
| Task.Sound | function | It is used to play sound. |