Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Function onChanged if?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

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

Log in to vote
0
Answered by
wazap 100
10 years ago
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.

Ad

Answer this question