What I’m Attempting
So, i’m trying to make it where when a phrase is said… an audio will play and then once that audio is done… it will be deleted… the only issue is I have no way of checking to see if the audio is playing or not.
What i’ve tried
I’ve tried changing my style to the .Playing system but that mainly works through the local system and that didn’t work…
Script
--Made By MillerrIAm
--------Variables-------
SoundName = "What" --Change this to the sounds name
SSound = game:GetService("ServerStorage").CrowdSounds
WSound = game:GetService("Workspace").CrowdSounds
----------- Messages -----------
--[[Change these below to what you want people to say to activate the sound.]]--
msg1 = "What"
msg2 = "what"
msg3 = "wat"
msg4 = "Wat"
--------Main Code------
game.Players.PlayerAdded:Connect(function(plr)
plr.Chatted:Connect(function(msg)
if msg == msg1 or msg == msg2 or msg == msg3 or msg == msg4 then
if not WSound:FindFirstChild(SoundName) then
SSound[SoundName].Volume = 1
SSound[SoundName]:Clone().Parent = WSound
WSound[SoundName]:Play()
if not WSound[SoundName]:Play() then
WSound[SoundName]:Stop()
WSound[SoundName]:Destroy()
end
end
end
end)
end)