Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't my script work in the real roblox game but work in testing?

Asked by 8 years ago
Edited 8 years ago
local MusicText = script.Parent.MusicText
playing = false
song = script.Parent.Song       
song2 = script.Parent.Song2
song3 = script.Parent.Song3
song4 = script.Parent.Song4
song5 = script.Parent.Song5
song6 = script.Parent.Song6
song7 = script.Parent.Song7
song8 = script.Parent.Song8
song9 = script.Parent.Song9
song10 = script.Parent.Song10
song11 = script.Parent.Song11
song12 = script.Parent.Song12
song13 = script.Parent.Song13
song14 = script.Parent.Song14
song15 = script.Parent.Song15
song16 = script.Parent.Song16
song17 = script.Parent.Song17
song18 = script.Parent.Song18
song19 = script.Parent.Song19


function playsong()
    if (playing == false) then
        song:Play()
        MusicText.Text = "Timber - Pitbull (Played by Server)" 
        playing = true
        wait(112.3)
        playing = false
    end
end

function playsong2()
    if (playing == false) then
        song2:Play()
        MusicText.Text = "Calvin Harris - This Is What You Came For (Played by Server)"
        playing = true
        wait(119.1)
        playing = false
    end
end

function playsong3()
    if (playing == false) then
        song3:Play()
        MusicText.Text = "Major Lazer ft. Justin Bieber & MØ - Cold Water (Played by Server)"
        playing = true
        wait(108.6)
        playing = false
    end
end

function playsong4()
    if (playing == false) then
        song4:Play()
        MusicText.Text = "Sia - Cheap Thrills (Played by Server)"
        playing = true
        wait(119)
        playing = false
    end
end

function playsong5()
    if (playing == false) then
        song5:Play()
        MusicText.Text = "The Chainsmokers ft. Halsey - Closer (Played by Server)"
        playing = true
        wait(120.5)
        playing = false
    end
end

function playsong6()
    if (playing == false) then
        song6:Play()
        MusicText.Text = "Zara Larsson - Lush Life (Played by Server)"
        playing = true
        wait(108.7)
        playing = false
    end
end

function playsong7()
    if (playing == false) then
        song7:Play()
        MusicText.Text = "Hailee Steinfeld - Love Myself (Played by Server)"
        playing = true
        wait(113.3)
        playing = false
    end
end

function playsong8()
    if (playing == false) then
        song8:Play()
        MusicText.Text = "Stand By You - Rachel Platten (Played by Server)"
        playing = true
        wait(119.9)
        playing = false
    end
end

function playsong9()
    if (playing == false) then
        song9:Play()
        MusicText.Text = "twenty one pilots - Heathens (Played by Server)"
        playing = true
        wait(119.5)
        playing = false
    end
end

function playsong10()
    if (playing == false) then
        song10:Play()
        MusicText.Text = "Justin Timberlake - Can't Stop the Feeling (Played by Server)"
        playing = true
        wait(120.2)
        playing = false
    end
end

function playsong11()
    if (playing == false) then
        song11:Play()
        MusicText.Text = "Treat You Better - Shawn Mendes (Played by Server)"
        playing = true
        wait(120.5)
        playing = false
    end
end

function playsong12()
    if (playing == false) then
        song12:Play()
        MusicText.Text = "Charlie Puth ft. Selena - We dont talk anymore (Played by Server)"
        playing = true
        wait(112.5)
        playing = false
    end
end

function playsong13()
    if (playing == false) then
        song13:Play()
        MusicText.Text = "One Call Away - Charlie Puth (Played by Server)"
        playing = true
        wait(119.4)
        playing = false
    end
end

function playsong14()
    if (playing == false) then
        song14:Play()
        MusicText.Text = "Justin Bieber - Sorry (Played by Server)"
        playing = true
        wait(77.5)
        playing = false
    end
end

function playsong15()
    if (playing == false) then
        song15:Play()
        MusicText.Text = "Maroon 5 - Animals (Played by Server)"
        playing = true
        wait(119.6)
        playing = false
    end
end

function playsong16()
    if (playing == false) then
        song16:Play()
        MusicText.Text = "Jacob Sartorius - Sweatshirt (Played by Server)"
        playing = true
        wait(92.6)
        playing = false
    end
end

function playsong17()
    if (playing == false) then
        song17:Play()
        MusicText.Text = "Ariana Grande - Into You (Played by Server)"
        playing = true
        wait(118.3)
        playing = false
    end
end

function playsong18()
    if (playing == false) then
        song18:Play()
        MusicText.Text = "Jacob Sartorius - Hit Or Miss (Played by Server)"
        playing = true
        wait(91.5)
        playing = false
    end
end

function playsong19()
    if (playing == false) then
        song19:Play()
        MusicText.Text = "Justin Bieber - What Do You Mean? (Played by Server)"
        playing = true
        wait(116.5)
        playing = false
    end
end



playsong()
wait(5)
playsong2()
wait(5)
playsong3()
wait(5)
playsong4()
wait(5)
playsong5()
wait(5)
playsong6()
wait(5)
playsong7()
wait(5)
playsong8()
wait(5)
playsong9()
wait(5)
playsong10()
wait(5)
playsong11()
wait(5)
playsong12()
wait(5)
playsong13()
wait(5)
playsong14()
wait(5)
playsong15()
wait(5)
playsong16()
wait(5)
playsong17()
wait(5)
playsong18()
wait(5)
playsong19()
wait(5)

I have tried searching up on this and have done changes to my script like changing my script to a local script (Which made the script not functional) and many more. But it still doesn't work.

Trying to make a music player but it only plays the first music then stops after the first music finishes in the actual game. However in testing, it plays all the music just fine.

0
Can you organize your code please? I can hardly make sense of it.. DepressionSensei 315 — 8y
0
Oppps Sorry... AbandonedRick 112 — 8y
0
Anyone have any idea how to solve this? AbandonedRick 112 — 8y
0
Tell me if this fixes it https://kobra.io/#/e/-KVU7s5B977rzwuYEaIF DepressionSensei 315 — 8y
View all comments (8 more)
0
the music doesn't seem to play AbandonedRick 112 — 8y
0
Sorry, try it now. Edited it DepressionSensei 315 — 8y
0
Okay AbandonedRick 112 — 8y
0
In testing, the songs work fine, but in game, only the first song plays then after that, nothing comes out AbandonedRick 112 — 8y
0
do i have to change it to a local script AbandonedRick 112 — 8y
0
nevermind AbandonedRick 112 — 8y
0
Thanks for your help! I changed the script to a local script and it works! AbandonedRick 112 — 8y
0
No problem! Glad it helped you :D DepressionSensei 315 — 8y

Answer this question