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

Can you pause scripts?

Right - I made this long script that basically plays audio end on end, switching songs when on ends. I want to create a screenGUI that, when you click it, pauses the whole thing, and that when you click play, it continues where it left off. Is it possible to pause a script while it's running?

1 answer

✓ Accepted answer
-- Try this,  I don't know were your Script is located or were the sound is being stored so adjust --accordingly
SoundObj = Put the sound Location here.

function Toggle()
if game.Workspace["Script Name here"].Disabled ==true then
game.Workspace["Script Name here"].Disabled = false
SoundObj:stop()
elsedo
game.Workspace["Script Name here"].Disabled = true
soundObj:Play()
end
end

--Assuming you will put this in to a button
script.Parent.MouseButton1Down:connect(Toggle)

4 comments

0

There's no actual 'Sound' to link to. My script creates new Sound instances, and changes the asset id

0

Do you know how to script?

0

Coming back to this - a year later - this was actually quite useful. Thanks.

0

lol

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