Hooks

Run your own server code when a player finishes a bus route.

Advanced Bus Job has no exports. It has one hook in gg_busjob/base/core/open/server.lua, which ships open so you can edit it.

When a route is completed

Lua
hooks.jobCompleted = function(payload)
    gg.miniBridge.challenge({source = payload.source, challenge_id = "gg_busjob_complete_route", count = 1})
end

Runs on the server each time a player finishes a route, after they are paid. By default it counts the route toward the Coin Shop challenge gg_busjob_complete_route when gg_coinshop is started, and does nothing otherwise.

FieldTypeMeaning
payload.sourcenumberThe driver's server id
payload.identifierstringThe driver's character identifier
payload.job_idnumberThe route's position in cfg.routeData
payload.rewardbooleantrue once the route pay and XP were given
payload.completed_stopsnumberStops completed
payload.total_stopsnumberStops on the route
payload.timestampnumberos.time() when the route finished

Add your own code below the Coin Shop line, for example to log routes or give an extra reward. An update replaces this file, so keep a copy of your changes.

Support

Questions before you buy?

Ask the team in our Discord before you pay a thing. Setup help, update notes, giveaways and discount codes, all in one place.

831 online now2,241 members