Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Function onChanged if?

Im having trouble with this, I need it to a frame to become invisible when a song starts to play and when the song stops playing

function onChanged(IsPlaying) 
	if script.Parent.ScrollingFrame.Sound.IsPlaying==true
		then script.Parent.ScrollingFrame.Visible = false
	elseif script.Parent.ScrollingFrame.Sound.IsPaused==true
		then script.Parent.ScrollingFrame.Visible = true
end
end
script.Parent.ScrollingFrame.Sound.IsPlaying.Changed:connect(onChanged) 

1 answer

function onChanged(IsPlaying) 
    if script.Parent.ScrollingFrame.Sound.IsPlaying then 
	script.Parent.ScrollingFrame.Visible = false
    elseif script.Parent.ScrollingFrame.Sound then 
	script.Parent.ScrollingFrame.Visible = true
	end
end
script.Parent.ScrollingFrame.Sound.Changed:connect(onChanged) 


That fixed the scripting error BUT

1 other problem is that IsPlaying and IsPaused are broken.

This discussion is preserved as it was. New answers, comments, and votes are closed.