-- Job simulation (requires ESX/QBCore) Config.SimulateJobs = false Config.JobWaypoints = postop = x = 102.4, y = -1287.4, z = 28.2 , taxi = x = 899.2, y = -180.3, z = 73.8
-- Chat simulation while true do Citizen.Wait(Config.ChatInterval * 1000) if #BotList > 0 then SimulateChatMessage() end end end)
RegisterCommand('removebots', function(source, args, raw) RemoveAllFakePlayers() end, false)
-- Optional: delete on resource stop AddEventHandler('onResourceStop', function(resourceName) if GetCurrentResourceName() == resourceName then for _, ped in pairs(FakePeds) do if DoesEntityExist(ped) then DeleteEntity(ped) end end end end) Locales = bot_joined = "~g~%s has joined the server.", bot_left = "~r~%s has left the server.", chat_prefix = "[BOT]"
-- Simulate join/leave effect function SimulateJoinLeave() if #BotList == 0 then return end local bot = BotList[math.random(#BotList)] TriggerClientEvent('chat:addMessage', -1, color = 100, 200, 100 , args = "System", bot.name .. " has joined the server." ) Citizen.Wait(30000) -- leave after 30 sec TriggerClientEvent('chat:addMessage', -1, color = 200, 100, 100 , args = "System", bot.name .. " has left the server." ) end
-- Movement style: 'wander' (random area) or 'waypoints' Config.Movement = 'wander'
server_scripts 'config.lua', 'server.lua'
-- Join/Leave simulation if Config.JoinLeaveInterval > 0 then Citizen.CreateThread(function() while true do Citizen.Wait(Config.JoinLeaveInterval * 60 * 1000) SimulateJoinLeave() end end) end local FakePeds = {} -- Create a fake player ped RegisterNetEvent('fpb:createFakePlayer') AddEventHandler('fpb:createFakePlayer', function(id, name, skin, coords) local model = GetHashKey(skin) RequestModel(model) while not HasModelLoaded(model) do Citizen.Wait(10) end
-- Name above head (optional) local blip = AddBlipForEntity(ped) SetBlipSprite(blip, 1) SetBlipColour(blip, 2) BeginTextCommandSetBlipName("STRING") AddTextComponentSubstringPlayerName(name) EndTextCommandSetBlipName(blip)
-- Cleanup model SetModelAsNoLongerNeeded(model) end)
-- Spawn a fake player function SpawnFakePlayer() local src = math.random(100000, 999999) -- fake id local name = GetRandomName() local skin = Config.Skins[math.random(#Config.Skins)] local coords = Config.Waypoints[math.random(#Config.Waypoints)]
-- Movement AI TaskWanderInArea(ped, coords.x, coords.y, coords.z, 50.0, 0.0, 0.0)
-- Simulate chat messages every X seconds Config.ChatInterval = 45 -- seconds
dependencies 'es_extended' -- or 'qb-core' – adjust as needed
-- Job simulation (requires ESX/QBCore) Config.SimulateJobs = false Config.JobWaypoints = postop = x = 102.4, y = -1287.4, z = 28.2 , taxi = x = 899.2, y = -180.3, z = 73.8
-- Chat simulation while true do Citizen.Wait(Config.ChatInterval * 1000) if #BotList > 0 then SimulateChatMessage() end end end)
RegisterCommand('removebots', function(source, args, raw) RemoveAllFakePlayers() end, false)
-- Optional: delete on resource stop AddEventHandler('onResourceStop', function(resourceName) if GetCurrentResourceName() == resourceName then for _, ped in pairs(FakePeds) do if DoesEntityExist(ped) then DeleteEntity(ped) end end end end) Locales = bot_joined = "~g~%s has joined the server.", bot_left = "~r~%s has left the server.", chat_prefix = "[BOT]" Fivem Fake Player Bot
-- Simulate join/leave effect function SimulateJoinLeave() if #BotList == 0 then return end local bot = BotList[math.random(#BotList)] TriggerClientEvent('chat:addMessage', -1, color = 100, 200, 100 , args = "System", bot.name .. " has joined the server." ) Citizen.Wait(30000) -- leave after 30 sec TriggerClientEvent('chat:addMessage', -1, color = 200, 100, 100 , args = "System", bot.name .. " has left the server." ) end
-- Movement style: 'wander' (random area) or 'waypoints' Config.Movement = 'wander'
server_scripts 'config.lua', 'server.lua' -- Job simulation (requires ESX/QBCore) Config
-- Join/Leave simulation if Config.JoinLeaveInterval > 0 then Citizen.CreateThread(function() while true do Citizen.Wait(Config.JoinLeaveInterval * 60 * 1000) SimulateJoinLeave() end end) end local FakePeds = {} -- Create a fake player ped RegisterNetEvent('fpb:createFakePlayer') AddEventHandler('fpb:createFakePlayer', function(id, name, skin, coords) local model = GetHashKey(skin) RequestModel(model) while not HasModelLoaded(model) do Citizen.Wait(10) end
-- Name above head (optional) local blip = AddBlipForEntity(ped) SetBlipSprite(blip, 1) SetBlipColour(blip, 2) BeginTextCommandSetBlipName("STRING") AddTextComponentSubstringPlayerName(name) EndTextCommandSetBlipName(blip)
-- Cleanup model SetModelAsNoLongerNeeded(model) end) y = -1287.4
-- Spawn a fake player function SpawnFakePlayer() local src = math.random(100000, 999999) -- fake id local name = GetRandomName() local skin = Config.Skins[math.random(#Config.Skins)] local coords = Config.Waypoints[math.random(#Config.Waypoints)]
-- Movement AI TaskWanderInArea(ped, coords.x, coords.y, coords.z, 50.0, 0.0, 0.0)
-- Simulate chat messages every X seconds Config.ChatInterval = 45 -- seconds
dependencies 'es_extended' -- or 'qb-core' – adjust as needed