Studios
Racinghouse-3.jpg

Examples

SoonRacingQbox
PAGE 04 OF 06  ·  CONFIGURATION → EXAMPLES → TROUBLESHOOTINGdocs.glitchstudios.dev
Browse docs

Open the hub with the headset#

Add racing_headset to ox_inventory, give it to a character and use it. The hub opens the same way as at a VR spot. To require the item at the spot as well:

Config.Hub = {
    item = 'racing_headset',
    itemRequiredForSpot = true,
}

Add a second VR spot#

Config.VRZones = {
    { label = 'VR Racing', coords = vec3(-1285.18, -305.52, 35.66), heading = 207.0, size = vec3(3.5, 3.5, 3.0), blip = false },
    { label = 'Car Meet VR', coords = vec3(100.0, 200.0, 30.0), heading = 90.0, size = vec3(3.0, 3.0, 3.0), blip = true },
}

Charge entry in race tokens#

Config.Economy.entryCurrency = 'race_token'
Config.Economy.maxEntryFee = 10
Config.Economy.tokenRewards = { [1] = 3, [2] = 2, [3] = 1 }

Let a player build stunt tracks without a licence#

add_ace identifier.license:YOUR_LICENSE glitch-racing.stunt allow
add_ace identifier.license:YOUR_LICENSE glitch-racing.create allow

Make licence A easier#

{ id = 'A', label = 'Pro', level = 8, wins = 10, colour = '#a855f7' },

Without glitch-xpSystem the level is ignored and only wins counts.

Add a car set#

{ id = 'classics', label = 'Classics', licence = 'D', vehicles = { 'btype', 'stinger', 'monroe', 'peyote' } },

Add the entry to Config.VR.sets. The models must be streamed on the server.

Check state from another resource#

if exports['glitch-racing']:IsRacing() then
    -- the local player is in a race
end

Fit a manual gearbox#

-- server side, veh is a server entity
exports['glitch-racing']:SetFittedTransmission(veh, 'manual')
exports['glitch-racing']:SetFittedTransmission(veh, 'auto')

-- this spawn only, not saved
exports['glitch-racing']:SetVehicleManual(netId, true)