[FREE][STANDALONE][TEST] Public Transport AI

Inside the script there should be an empty list which you would have to add the id of the car or vehicle that you want to allow people to enter.

I find the bus stops behind parked cars on the street. This stacks up the buses behind it on the route. I’m going to tweak the driving settings to see if I can convince the AI to go around. Also, I need to see if my car HUD can be convinced not to activate if I am on the bus. Just gets in the way. I’m going to play with it when I get home in a few hours.

1 Like

yesterday, your script worked for me, today i downloaded latest version, and now no bus spawns anymore. Unfortunately i deleted previous version… :frowning:

I restarted Server several times.

[script:publictranspo] SCRIPT ERROR: @publictransport/server/main.lua:56: attempt to get length of a boolean value (field ‘?’)

Everything working. just need a bus counter so we dont end up with 12 buses doing the same thing
image

at the moment we get only:

nice release

1 Like

To avid this I added a temp line of code in the first thread of the server main

Citizen.CreateThread(function()
    -- If you change the 1 as your current id you can restart the resrouce and test it
   -- without need to log out and log in
	players[1] = true
	while true do
		if GetPlayerNum() == 0 then
			-- Waiting for first spawn
			Wait(30000)

But that’s the point. There are 12 buses following the route ‘60’. If you have more route you will have another Bus 30 <1/12>

I don’t know exactly what you mean or how exactly I do it

Right i get that. Do they despawn after a while or does it just keep adding new busses to the route. Will we end up with 80 buses on one route?

1 Like

I dont know why but for me doenst work with updated positions :frowning:
(No errors in console/f8, also after restart the server)

I have not updated but now the buses are not

does not with with qbcore, bilps are visible, but thats all

2 Likes

Super cool, and free? Kudos to you.

I have the same question.

Can you send code?

It should not give you a problem, just make sure that the coordinates and the heading are in the same format

If I already saw that there are some flaws with the flags that I told you, good that you found it

How do i trigger the bus to show up?

Code for what?