My script wont change the text at all, I tried fixing it but it's too lazy to change it.

How do I fix this?

The songs in the script are examples

local titleLabel = script.Parent.TitleLabel
local genreLabel = script.Parent.GenreLabel
local bpmLabel = script.Parent.BPMLabel
local artistLabel = script.Parent.ArtistLabel
local currentTrack = game.ReplicatedStorage.CurrentTrack
local title = game.ReplicatedStorage.Title

if currentTrack.Value == "(none)" then
	titleLabel.Text = "No song is playing..."
else
	if currentTrack.Value == "On My Mind" then
		titleLabel.Text = "Title: " .. currentTrack.Value
		genreLabel.Text = "Genre: Bass House"
		bpmLabel.Text = "BPM: 124"
		artistLabel.Text = "Matroda"
	elseif currentTrack.Value == "You Don't Know Me" then
		titleLabel.Text = "Title: " .. currentTrack.Value
		genreLabel.Text = "Genre: Vocal House"
		bpmLabel.Text = "BPM: 130"
		artistLabel.Text = "Armand Van Helden"
	end
end

currentTrack:GetPropertyChangedSignal("Value"):Connect(function()
	if currentTrack.Value == "(none)" then
		titleLabel.Text = "No song is playing..."
	else
		if currentTrack.Value == "On My Mind" then
			titleLabel.Text = "Title: " .. currentTrack.Value
			genreLabel.Text = "Genre: Bass House"
			bpmLabel.Text = "BPM: 124"
			artistLabel.Text = "Matroda"
		elseif currentTrack.Value == "You Don't Know Me" then
			titleLabel.Text = "Title: " .. currentTrack.Value
			genreLabel.Text = "Genre: Vocal House"
			bpmLabel.Text = "BPM: 130"
			artistLabel.Text = "Armand Van Helden"
		end
	end
end)

5 comments

0

Do you have an error in your output?

0

No, it didn't show any error in the output. It was as if it looked perfect.

0

A general principle is that what you give is what you get, the computer isn't lazy it's just that the code is at fault. Secondaly, why do you have lines 08 to 22? You have the same code inside the function at line 24. Have you tried changing currentTrack's value?

0

I bet it's going to break if I force the math.random to be at that song, but I guess I'll try

0

Nope, didn't do anything when I just set it's value