I'm trying to insert sound effects for my game and i found a good one created by Roblox. The problem is the sound effect i need is at the beginning of the sound file and not the full sound file. I know i can record the part that i need, but i'm afraid that's copyright since it's one of the songs Roblox got from APM Music in their contract. If there's no way possible, could you recommend me a software to make custom sounds
✓ ANSWER ACCEPTED
How to stop a sound file while it's playing?
1 answer
✓ Accepted answer
Use the stop method along with the IsLoaded property so it doesn’t stop where you don’t want it to stop.
Say, there’s a sound in workspace called Sound1 and I wanted to stop it after 5 seconds, this is how I do it:
local sound = workspace:WaitForChild(“Sound”)
function StopSound()
sound:Play()
if sound.IsLoaded == true then
wait(5)
sound:Stop()
end
end
Hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Remember to also have something to trigger the function so it runs.
You can also check the TimePosition