local Script
local Sound = Instance.new("Sound")
-- Play
PlayBtn.MouseButton1Click:Connect(function()
Sound.SoundId = "rbxassetid://"..tostring(Search.Text)
print(Sound.SoundId)
SoundService:PlayLocalSound(Sound)
Sound.Playing = true
end)
--Pause/Resume
PauseBtn.MouseButton1Click:Connect(function()
if Sound.Playing == true then
Pause:FireServer(Player, Sound)
Sound.Playing = false
print("Sound Is Playing")
elseif Sound.Playing == false then
Resume:FireServer(Player, Sound)
Sound.Playing = true
print("Sound Is Not Playing")
end
end)
--Stops/Destroy
StopBtn.MouseButton1Click:Connect(function()
Resume:FireServer(Player, Sound)
end)
Server Script
Pause.OnClientEvent:Connect(function(Player, Sound)
Sound:Pause()
end)
Resume.OnClientEvent:Connect(function(Player, Sound)
Sound:Resume()
end)
Resume.OnClientEvent:Connect(function(Player, Sound)
Sound:Stop()
end)