I edited a knife script that plays a song in the handle whenever you equip it, and it stops playing when you unequip it.
I wanted the song to stay at the place it left off, but even if I put Song:Pause() it still resets the song when I re-equip it.
I edited a knife script that plays a song in the handle whenever you equip it, and it stops playing when you unequip it.
I wanted the song to stay at the place it left off, but even if I put Song:Pause() it still resets the song when I re-equip it.
I don't think, that it broke, I tried myself and this worked, but it didn't pause, it stopped. If you didn't, add a new script. Put this in:
local song = script.Sound
script.Parent.Equipped:connect(function()
song:Play()
end)
script.Parent.Unequipped:connect(function()
song:Pause()
end)
if you didn't open output, then you probably didn't find the reason, why it didn't work. You've probably wrote Unequipped wrong, I did so and It played the song when I unequipped it.
As I said, it works like :Stop() does, so you can use :Stop() instead.
This discussion is preserved as it was. New answers, comments, and votes are closed.
4 comments
Oh, I forgot to clarify that I meant it only stops and resets the song, not pausing it like I think it would do.
Yes, and it does that, but I still don't see why did you accept my question q.q.
answer*
I found the answer, instead of using Play() I use Resume() And it stays at the place