Jump to content

creating image when resources loading


TDK(RU)

Recommended Posts

The easiest way to do this is not to monitor what I expect you thought as the obvious "onClientPlayerJoin", as,

It is triggered for all players other than the local player.

Instead, use event "onClientResourceStart", attached to "getResourceRootElement(getThisResource())". This will run your code for displaying the image for that client when it's own resource is first started. (That bit is important: don't use getRootElement() or the code will run when ANY resource starts, including maps and gamemodes) The first time a resource starts for players (assuming it was already running on the server) is after all resources have finished downloading, making this the earliest point after a player connects to run scripts on them.

Link to comment

The easiest way to do this is not to monitor what I expect you thought as the obvious "onClientPlayerJoin", as,

It is triggered for all players other than the local player.

Instead, use event "onClientResourceStart", attached to "getResourceRootElement(getThisResource())". This will run your code for displaying the image for that client when it's own resource is first started. (That bit is important: don't use getRootElement() or the code will run when ANY resource starts, including maps and gamemodes) The first time a resource starts for players (assuming it was already running on the server) is after all resources have finished downloading, making this the earliest point after a player connects to run scripts on them.

Link to comment

Obviously, you can't show a client-side image if that client hasn't downloaded the script and image - that's why this idea is flawed from the very outset. Your options for showing anything at all before client-side scripts are available are very limited, you'd have to make do with text displays or something.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...