LoadingScreen // JavaScript / Rainbow Text / Clean

Nice work, love the loading screen. Everything went A okay with the loading screen, then I tried adding my music. So I did what I’m pretty sure was suppose to be

  • I deleated the default music from the music folder
  • I added my converted .ogg music file to the music folder
    After that the loading screen is still fine, but now there is no music :confused:

the .ogg song must have the name “music”, otherwise the system will not read the song and not load it, unless you can edit the song name from index.html and from __resource.lua.
like this !
image
image
image

i just take the wallpaper but ok , and where it is written that I can’t look at a tutorial I learned more

I fixed the music problem by changing the name to “music.ogg” as you said. But the music cuts off very early, do you have a solution to this?

this was solved by @J0k3rc1to credits to him !

var play = false;
var myAudio = document.getElementById("leson");
myAudio.autoplay = true;
myAudio.load();

myAudio.volume = 0.7;


function onKeyDown(event) {
        switch (event.keyCode) {
            case 32: //SpaceBar                    
                if (play) {
                    myAudio.pause();
                    play = false;
                } else {
                    myAudio.play();
                    play = true;
                }
                break;
        }
  return false;
}
window.addEventListener("keydown", onKeyDown, false);
</script>
2 Likes

Where do I put this?

1 Like

index.html

1 Like

image , if you’re reffering to index.htlm in the baby_loading resource this is all that shows and when I open it, a new tab opens up with my loading screen.

1 Like

soon the v 2.0 :))

1 Like

Hey, i’ve got a question.
Why does my music stops after 5 to 6 seconds?

I’ve tried it with many different tracks (.ogg) and it’s every try the same.

1 Like

first of all, sorry for the delay I had problems with the pc, and I already said it was a problem in the html from the music script, it was solved by @J0k3rc1to, you can find it here

<audio controls id="leson" src="music/music.ogg" type="audio/ogg" hidden="true" loop="true"/>
		<script>
	

    var play = false;
    var myAudio = document.getElementById("leson");
    myAudio.autoplay = true;
    myAudio.load();
    
    myAudio.volume = 0.7;
	
	
    function onKeyDown(event) {
            switch (event.keyCode) {
                case 32: //SpaceBar                    
                    if (play) {
                        myAudio.pause();
                        play = false;
                    } else {
                        myAudio.play();
                        play = true;
                    }
                    break;
            }
      return false;
    }
    window.addEventListener("keydown", onKeyDown, false);
    </script>
1 Like

That doesn’t fix it for me.

2 Likes

Hello good loadingscreen but I have a problem that loadingscreen me slashed and when I connect so it does not connect to the server and when I remove it so what to do with it?

1 Like

Hello good loadingscreen but I have a problem that loadingscreen me slashed and when I connect so it does not connect to the server and when I remove it so what to do with it?

1 Like

Music stop 2 seconds into the song for me :confused: anyone know how I can fix this?

1 Like

I don’t understand why you have this problem, it works perfectly for me, anyway I will put v2 soon

1 Like

I’m working on this problem because I don’t understand why!

1 Like

I just change in the html .ogg to .mp3 and also changed music/music.ogg to music.mp3 the _resource.lua
It fixed for me.

1 Like

the v2.0 will be released soon without the music bug

1 Like

How do I change the name to my RP server name? @BaByGeRRy

1 Like