Your problem is line 4: the way it's set up, it's saying "Clone's Parent == Workspace," not "songplay is a song clone, now after set the parent." You're essentially doing on line 5 BOOL:Play(), when that's not possible.
The solution would be to separate the two: take out the .Parent == game.Workspace, b/c it's not setting the parent, and == means to compare two values.
local NewSong = RandomlyPickedSong:Clone()
NewSong.Parent = game.Workspace
NewSong:Play()
Now, as to how I concluded this, if you'd've printed line 4, it would've looked something like this:
print(songplay)
Believe it or not, this was very simple. XP Dw though, sometimes I miss stuff like this too. :)
Now to recap on ==, it means to compare (two) values, like if value2 == value2 then; the == operator is commonly shown to be used in if statements, b/c it's an operator used to compare (two) values; try to remember this if you can't remember: = means to set a value, while two of them together means to compare values. :)
Here's an example of the == operator, and how your script interpreted it:
local String = 'I\'m in a string! :D'
local CompareOperatorExample = String == 'I\'m in a string! :D'
print(CompareOperatorExample)
CompareOperatorExample = String == 'I\'m alive! :D'
print(CompareOperatorExample)
local String = 'I\'m in a string! :D'
local CompareOperatorExample = String == 'I\'M MAGIC!'
if CompareOperatorExample then
print('MERASMUS')
else
print('NO MAGIC 4 YOU')
end
local String = 'I am alive :)'
local CompareOperatorExample = String ~= 'I am alive :)'
print(CompareOperatorExample)
Hope this helped you in any way! :D
1 comment
Thank you!