Awaiting scripts : stuck on screen for ages

Hi, I haven’t found the solution to Awaiting scripts screen stuck.
Previously I used to write code for ANOTHER MP but now have decided to change the platform as more prospect.

On first connection to server I have bridge screen (events playerConnecting & playerJoining work)


then I do recconect via F8 and get this (events playerConnecting & playerJoining DONT work)

CitizenFX.log
CitizenFX_log_2021-08-15T183447.log (224.9 KB)

Server shows no errors. Idk how to fix this.




Run ShutdownLoadingScreen() on client.

Can U tell how to get current player?
In another mp project player was the first argument of every event and server-build function but here it’s kinda weird as for me.

Wrote this

on(`playerJoining`, (targetPlayer) => {
    try 
    {
	    info(`playerJoining`, 'Connected');
		
		emitNet("shutdownLoading", targetPlayer);
    }
    catch (e) 
    {
	    error(`playerJoining`, e);
    }
});

on client

on(`shutdownLoading`, () => {
	ShutdownLoadingScreen();
});

No effect because on client it should be

onNet(`shutdownLoading`, () => {
	ShutdownLoadingScreen();
});

I am not sure if events get queued for client to run when they finish loading, playerJoining is triggered when they start loading.

You can just run ShutdownLoadingScreen() in top-level code.

Made some work and got it

I suppose I have to spawn player now?
What is the name of event when everything is ready for spawning?
Could You please be so kind to tell it? :slight_smile:


It means that spawnmanager is not ready yet?

Is it okay that spawnmanager is written in LUA but I write in JS?

Also I get this after a while

1 Like

Ah, I forgot to mention DoScreenFadeIn as well.

There is none, client scripts just don’t run until this is the case.

Yes, however spawnmanager currently doesn’t have any server-side exports. I’m not sure why, maybe nobody asked for these before?

Are you running the server locally? Seems like something you’re doing is freezing the server.

I know what’s going on, because you need to start a resource called “basic-gamemode” after “spawnmanager”

ensure spawnmanager
ensure basic-gamemode

or

put the following script in other client.lua (But the first method is recommended)

AddEventHandler('onClientMapStart', function()
   exports.spawnmanager:setAutoSpawn(true)
   exports.spawnmanager:forceRespawn()
end)

Then restart your server, enjoys! :grinning:

2 Likes