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

Why doesn't this stop?

Asked by 9 years ago

It should stop the song, but it doesn't?

--

local sound = game.Workspace.Part
local enable = true
local sound2 = game.Workspace.Part.Sound

--



function Clicked()
    if not enable then return end
    enable = false
    sound.Sound:Play()
    wait(sound.Sound.TimeLength)
    sound.Sound:Stop()
    enable = true


if sound.Sound2.IsPlaying == true then
        sound.Sound:Pause()
        end

end
script.Parent.MouseButton1Click:connect(Clicked)


0
Try removing the sound,Then to re-play re add it in. iLegitus 130 — 9y
0
I'm quiet new to scripting, I don't really understand what you mean. UnleashedGamers 257 — 9y
0
Is this script inside a Gui, or an Object? If it's in an object does it have a ClickDetector in it? dyler3 1510 — 9y
1
using the "if" on line 20, only works once. woodengop 1134 — 9y
View all comments (3 more)
0
It is in the text button. UnleashedGamers 257 — 9y
0
Couldn't you just set the sound to not repeat in the sound properties? parkderp1 105 — 9y
0
Looping doesn't have to do with this, if you do understand what I mean here is a desc of it : When a player clicks a song and that song plays NO other songs can play until that song is done. UnleashedGamers 257 — 9y

1 answer

Log in to vote
-1
Answered by 9 years ago

You need a ClickDetector inside the brick.

1
How is that even relevant? Redbullusa 1580 — 9y
0
It's a text button... UnleashedGamers 257 — 9y
Ad

Answer this question