if game.Workspace["EDM MIXER 1"].edmmix.MusicPlayer.PlaylistA.SongA1.Pitch = 1 then script.Parent.Text = "Value: Even" elseif game.Workspace["EDM MIXER 1"].edmmix.MusicPlayer.PlaylistA.SongA1.Pitch = 1.1 then script.Parent.Text = "Value: +1" end
on the = sign for line one it says expected then near =, and it doesn't work. :/
Use "==" instead of "=" because "=" is assigning something to another thing, and "==" is comparing two things, which is what you're trying to do.
So if you're trying to set a property to true, you would say:
workspace.Part.Anchored = true
but if you wanted to check if workspace.Part.Anchored = true then you'd say:
if workspace.Part.Anchored == true then --code end
Next time, please put your code in code block. You can do this by clicking the blue lua symbol above the text pad, then put your code inside the numeral tilde keys.
Your problem is that you're using the definition operator for a comparitive statement
=
is the definition operator, it's used to define things.
==
* is the comparitive operator, it's used to compare whether or not two things are identical to eachother.*
So to fix your code, on the first and third lines then just add one more equal sign(:
(NOTE: You can access the Workspace by just saying workspace
. Also, assigning variables
can make for much cleaner and faster code - faster meaning you don't have to retype everything)
--Lets make a variable for your song local songa1 = workspace["EDM MIXER 1"].edmmix.MusicPlayer.PlaylistA.SongA1 --Now we can use the variable here(: if songa1.Pitch == 1 then script.Parent.Text = "Value: Even" elseif songa1.Pitch == 1.1 then script.Parent.Text = "Value: +1" end