#Lyrics script
19 messages · Page 1 of 1 (latest)
do pinrt (currentsoundID, disredsound ID) before the string.find to see if it has it first
** You are now Level 11! **
the GUI text are not changing, it print(lyric) looks ok, why is that?
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
HMMMM
So it “kind of” works, but only shows the first two lines, then stops completely
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
for LyricTime, lyric in pairs(mySongLyrics) do
print(LyricTime.. " ".. lyric)
if LyricTime <= RadiosTime then
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