:Stop() is not Stopping sound

im having problems with my sound not stopping when im trying to stop it

--- This script is inside a server script in a part
local promt = script.Parent.ProximityPrompt
game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        promt.Triggered:Connect(function(player)
            local LocalPlayer = player
            local PlayerGui = Player:WaitForChild("PlayerGui")
            local ScreenGui = PlayerGui.BlackFadeStoreYeahYeah
            local Frame = ScreenGui.Frame
            if LocalPlayer then
                if Player then
                    game.Workspace.Woahh:Stop()
                    Player.CameraMinZoomDistance = 0.5
                    LocalPlayer.Character:FindFirstChild("Humanoid").WalkSpeed = 0
                    Frame.Visible = true
                    script.Parent.Sound:Play()
                    wait(0.25)
                    Player.CameraMaxZoomDistance = 0.5
                    LocalPlayer.Character:SetPrimaryPartCFrame(CFrame.new(game.Workspace.Teleports.DoorInsideTeleport.Position))
                    wait(1)
                    game.Workspace.Union.Bruh:Play()
                    LocalPlayer.Character:FindFirstChild("Humanoid").WalkSpeed = 10
                    Frame.Visible = false
                end
            end
        end)
    end)
end)

Why do you have the PlayerAdded and CharacterAdded? You just need the Triggered event and it should work?

local promt = script.Parent.ProximityPrompt

promt.Triggered:Connect(function(player)
	local PlayerGui = player:WaitForChild("PlayerGui")
	local ScreenGui = PlayerGui.BlackFadeStoreYeahYeah
	local Frame = ScreenGui.Frame
	
	workspace.Woahh:Stop()
	player.CameraMinZoomDistance = 0.5
	player.Character:FindFirstChild("Humanoid").WalkSpeed = 0
	Frame.Visible = true
	script.Parent.Sound:Play()
	wait(0.25)
	player.CameraMaxZoomDistance = 0.5
	player.Character:SetPrimaryPartCFrame(CFrame.new(workspace.Teleports.DoorInsideTeleport.Position))
	wait(1)
	workspace.Union.Bruh:Play()
	player.Character:FindFirstChild("Humanoid").WalkSpeed = 10
	Frame.Visible = false
end)
1 Like

I figured it out apparently another script kept looping it, thanks for replying though.

1 Like