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

Why is this breaking?

Asked by
NotSoNorm 777 Moderation Voter
10 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

I'm a very "noobish" scripter, What am I doing wrong?

while true do
    wait(0.5)
if script.Parent.ScrollingFrame.Sound.IsPlaying = true
        then script.Parent.ScrollingFrame.Visible = false
        then script.Parent.SongPlayNoter.Visible = true
elseif script.Parent.ScrollingFrame.Sound.IsPlayer = false
        then script.Parent.ScrollingFrame.Visible = true
        then script.Parent.SongPlayNoter.Visible = false
    end
end

4 answers

Log in to vote
0
Answered by 10 years ago
while true do
    wait(0.5)
    local isPlaying = script.Parent.ScrollingFrame.Sound.IsPlaying
    script.Parent.ScrollingFrame.Visible = not isPlaying
    script.Parent.SongPlayNoter.Visible = isPlaying
end

Your script itself had two main errors; you were using "=" for comparison instead of "==", and you were indexing "isPlayer" in the second if statement.

Ad
Log in to vote
-1
Answered by 10 years ago
while true do
    wait(0.5)
if script.Parent.ScrollingFrame.Sound.IsPlaying == true then
        script.Parent.ScrollingFrame.Visible = false
        script.Parent.SongPlayNoter.Visible = true
elseif script.Parent.ScrollingFrame.Sound.IsPlayer == false then
        script.Parent.ScrollingFrame.Visible = true
        script.Parent.SongPlayNoter.Visible = false
    end
end

Just change where you put the "Then"

0
That says its wrong ;o? NotSoNorm 777 — 10y
0
Oh! You have to do == so it checks if the sound is playing Tempestatem 884 — 10y
0
Oh :P NotSoNorm 777 — 10y
Log in to vote
-1
Answered by 10 years ago

Error at line 3 and line 7.

I wasn't sure where the end's were supposed to go, so II assumed they go in these places.

while wait(0.5) do
if script.Parent.ScrollingFrame.Sound:Play() then
script.Parent.ScrollingFrame.Visible = false
script.Parent.SongPlayNoter.Visible = true
elseif not script.Parent.ScrollingFrame.Sound:Play()then
script.Parent.ScrollingFrame.Visible = true
script.Parent.SongPlayNoter.Visible = false
end end
Log in to vote
-1
Answered by 10 years ago

Line 3 and 6, You are comparing. So ==. Not =.

Answer this question