#Lyrics script

19 messages · Page 1 of 1 (latest)

torpid ferry
#

help!! no errors! and not printing anything out

silk quest
#

do pinrt (currentsoundID, disredsound ID) before the string.find to see if it has it first

untold orchidBOT
#

studio** You are now Level 11! **studio

torpid ferry
silk quest
#

lyric is not defined within the function

#

or yo uhave to change the lyric to a string

torpid ferry
#

local LyricsDisplay = script.Parent["Now Playing"].LyricDisplay.SurfaceGui.LyricsDisplay
local Radio = script.Parent.MusicPlayer.CurrentSong

local mySongLyrics = {





    [1.000] = "lyrics 1",
    [2.000] = " lyrics 2",
    [3.000] = "lyrics 3"

}




local lastLyric = "" -- Variable to store the last displayed lyric

function Lyrics()
    while true do
        local RadiosTime = Radio.TimePosition
        local nextLyric = nil

        for LyricTime, lyric in pairs(mySongLyrics) do
            if LyricTime <= RadiosTime then
                nextLyric = lyric
                break -- Exit the loop after finding the next lyric
            end
        end

        if nextLyric and nextLyric ~= lastLyric then
            LyricsDisplay.Text = nextLyric
            lastLyric = nextLyric
            print(nextLyric)
        end

        wait(0.1)
    end
end

Lyrics()
#

@silk quest Heres the full script, there’s something wrong, it won’t tell me

silk quest
#

HMMMM

torpid ferry
#

So it “kind of” works, but only shows the first two lines, then stops completely

silk quest
#
    print(Index .. " ".. Value)


end
#

I am stupid and I pairs loops with differnt names confuse me

#

try printing out more stuff where you think there is an issue

#

Index = Position in the array
Value = the Value of the position

torpid ferry
#

Like this?

#

It prints the right things, but shows only 2 lines

#
function Lyrics()
    while true do
        local startTime = Radio.TimePosition

        for LyricTime, Lyric in pairs(mySongLyrics) do
            if LyricTime <= startTime then
                LyricsDisplay.Text = lyric
                print(lyric)
            end
        end

        task.wait(0.1)  
    end
end

This was the original script i used,

#

Maybe this one will be easier to see