I need help making my script

hey everyone I am making a new music game and I am having a hard time trying to make a script that looks at a string value called dancing in a while true loop and then checks another string value called Song chosen and then based of the song chosen string calls a function for the chosen song
the part were it checks for the dancing string already works I am just trying to make the part were based of the song chosen string calls a function for the chosen song.

here is what I have now

strings
Screenshot 2022-04-05 200455strings

and here is what I tried but did not work


(also if this is the wrong category sorry this is my first post.)

Your Code v

local function checkifsong1()
  if songchosen == "Song1" then -- Messed Up Here
    songcheckchosen = true
  end
end

Correct Code v

local function checkifsong1()
  if songchosen.Value == "Song1" then
    songcheckchosen = true
  end
end

based of what you just gave me I got a new idea because an error occurred and gave me this Workspace.Epic.Script:21: attempt to call a string value, and the new Idea I got was to just put the if statements inside the while loop and then plays a function like that but for now I am using printing to see if it works until I actually make the working function but nothing happens it only keeps printing “daning s set to dancing” and that is suppose to happen but it is not printing any thing else

Use elseif instead of creating a new if :slight_smile:

if this then

elseif that then

elseif thas then

else
    return;
end
1 Like

I just tried this and it is still just printing “daning s set to dancing” here is what I typed:

Screenshot 2022-04-05 213306tryiedbutstilnotworking

Right about if songchosen.Value == "Song1" then … do me a favor and add this: print(songchosen.Value)

1 Like

hey sorry for the late response, I just found the problem! after you said to print(songchosen.Value) I just thought of what if it was a capitalized letter that messed the script up so I checked the names of the songs and I messed up when I made the capital S in song1, song2, song3 and song4, thanks for helping me fix the problem :smile: