QBCore VibeCode DevKit
The DevKit that stops AI from hallucinating, overengineering, rewriting your scripts, or breaking your server.
It forces AI to behave like a real QBCore developer, not a guess machine.
Why this DevKit exists
AI can write QBCore code โ but left unsupervised, it will:
- invent functions that donโt exist
- rewrite entire scripts you never asked to change
- loop your CPU to hell
- skip validation
- break player data
- ignore clean server/client separation
- output ESX logic by accident
- forget what you told it two minutes ago
Youโre not buying a template.
Youโre buying a behaviour correction system for AI.
This DevKit forces AI to output code that is:
- structured
- minimal
- event-driven
- predictable
- fixable
- QBCore-native
If you want AI that actually codes with you, not against you, this is the kit.
If your AI keeps hallucinating, breaking your scripts, or ignoring QBCore conventions, this DevKit fixes it permanently.
-- BEFORE AND AFTER BELOW --
BEFORE:
๐ Resource Structure
qb_repuhousing/
โ
โโโ fxmanifest.lua
โโโ config.lua
โโโ server/
โ โโโ main.lua
โ โโโ reputation.lua
โ โโโ furniture.lua
โ
โโโ client/
โโโ main.lua
โโโ interiors.lua
โโโ furniture.lua
๐ fxmanifest.lua
fx_version 'cerulean'
game 'gta5'
name 'qb_repuhousing'
author 'AJ + ChatGPT'
description 'Reputation-based Apartment & Housing System for QBCore'
version '1.0.0'
shared_scripts {
'config.lua'
}
client_scripts {
'client/interiors.lua',
'client/furniture.lua',
'client/main.lua',
}
server_scripts {
'@oxmysql/lib/MySQL.lua',
'server/reputation.lua',
'server/furniture.lua',
'server/main.lua',
}
lua54 'yes'
โ๏ธ config.lua
Reputation logic + tiers + interior sets.
Config = {}
Config.Tiers = {
["crackhouse"] = {
label = "Crackhouse",
minRep = 0,
maxCrimRep = 9999, -- nobody cares, it's a crackhouse
interior = "shell_crack",
rent = 50
},
["loft"] = {
label = "Downtown Loft",
minRep = 200,
maxCrimRep = 200,
interior = "shell_loft",
rent = 300
},
["penthouse"] = {
label = "Penthouse Suite",
minRep = 600,
maxCrimRep = 50,
interior = "shell_penthouse",
rent = 1500
}
}
Config.InteriorUpgrades = {
[1] = { label = "Starter", props = {"broken_tv", "dirty_bed"} },
[2] = { label = "Improved", props = {"flat_tv", "clean_bed"} },
[3] = { label = "Luxury", props = {"curved_tv", "king_bed"} }
}
Config.FurnitureBreakChance = 0.10 -- 10% per "stressful player interaction"
๐ง server/reputation.lua
Pull rep from your existing reputation system or store it here.
QBCore = exports['qb-core']:GetCoreObject()
function GetPlayerReps(source)
local Player = QBCore.Functions.GetPlayer(source)
return {
civ = Player.PlayerData.metadata["civrep"] or 0,
crim = Player.PlayerData.metadata["crimrep"] or 0
}
end
exports("GetPlayerReps", GetPlayerReps)๐ server/main.lua
Handles leasing, tier access checks, and interior upgrades.
RegisterNetEvent("qb_repuhousing:attemptLease", function(tier)
local src = source
local reps = exports["qb_repuhousing"]:GetPlayerReps(src)
local t = Config.Tiers[tier]
if not t then
return TriggerClientEvent("QBCore:Notify", src, "Invalid housing tier.", "error")
end
if reps.civ < t.minRep then
return TriggerClientEvent("QBCore:Notify", src, "Landlord laughs at your reputation.", "error")
end
if reps.crim > t.maxCrimRep then
return TriggerClientEvent("QBCore:Notify", src, "Landlord Googled you. Lease denied.", "error")
end
MySQL.insert("INSERT INTO player_housing (citizenid, tier, interior_level) VALUES (?, ?, ?)", {
QBCore.Functions.GetPlayer(src).PlayerData.citizenid,
tier,
1
})
TriggerClientEvent("qb_repuhousing:leased", src, tier)
TriggerClientEvent("QBCore:Notify", src, "Welcome home!", "success")
end)๐จ client/interiors.lua
Switches interiors based on tier + upgrade level.
local currentInterior = nil
RegisterNetEvent("qb_repuhousing:enterUnit", function(data)
local tier = data.tier
local level = data.level
local shell = Config.Tiers[tier].interior
local upgradeProps = Config.InteriorUpgrades[level].props
if currentInterior then
DeleteEntity(currentInterior)
end
currentInterior = exports["qb-interior"]:Create(shell, data.coords)
Wait(100)
for _, prop in ipairs(upgradeProps) do
exports["qb-interior"]:AddProp(prop)
end
end)
๐ฅ server/furniture.lua
Furniture break logic.
RegisterNetEvent("qb_repuhousing:stressEvent", function(houseId)
local src = source
if math.random() < Config.FurnitureBreakChance then
TriggerClientEvent("qb_repuhousing:breakFurniture", src)
TriggerClientEvent("QBCore:Notify", src, "Something definitely snappedโฆ", "error")
end
end)
๐ช client/furniture.lua
Randomized destructive results.
local breakSounds = {
"glass_shatter",
"wood_crack",
"metal_clang"
}
RegisterNetEvent("qb_repuhousing:breakFurniture", function()
local furniture = GetClosestObjectOfType(GetEntityCoords(PlayerPedId()), 2.0, 0, false)
if furniture ~= 0 then
PlaySoundFrontend(-1, breakSounds[math.random(#breakSounds)], "DLC_HEIST_BIOLAB_PREP_HACKING_SOUNDS", true)
FreezeEntityPosition(furniture, true)
SetEntityHealth(furniture, 0)
end
end)
๐ฎ client/main.lua
Lease menu, notifications, testing commands.
RegisterCommand("leaseapt", function(_, args)
local tier = tostring(args[1])
TriggerServerEvent("qb_repuhousing:attemptLease", tier)
end)
RegisterCommand("rage", function()
TriggerServerEvent("qb_repuhousing:stressEvent")
end)
But what you get is lies and regret for trying, next thing you know.. you're 4 hours deep in "WHY WONT THIS THING ACT SMART?!"
AFTER:
Filenames have been hidden for IP Protection.
It includes: