Robbery Integration
A simple example for a robbery integration.
Using exports (example)
To display active robberies on the scoreboard, you can integrate robbery scripts using exports. Below is an example configuration using the esx_holdup
script.
Set the export in the scoreboard config.lua
config.lua
scoreboardConfig.robberies = {
["Shop Robbery"] = export.esx_holdup:getStatus(), -- Title and export
}
Create the export in the server.lua
of your robbery script
server.lua
of your robbery scriptlocal rob = false
RegisterServerEvent("esx_holdup:tooFar", function(currentStore)
rob = false
end)
RegisterServerEvent("esx_holdup:robberyStarted", function(currentStore)
rob = true
end)
exports("getStatus", function()
return rob
end)
Explanation
rob
is a simple boolean that tracks whether a robbery is in progress.The
getStatus
export returns this value so other scripts (like the scoreboard) can read it.This allows your scoreboard to display real-time robbery information using external script data.
Last updated
Was this helpful?