Sound playing help

I have a sound inside a block when you colect it it does not make the sound for some reason and there is no errors and it continues with the rest of the script?

script.Parent.Part4.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if plr then
		--make the part go to the players humanoid bace part by tweening it towards the player
		local tweenService = game:GetService("TweenService")
		local part = script.Parent
		local goal = {}
		goal.Position = plr.Character.HumanoidRootPart.Position
		goal.Orientation = Vector3.new(0, 0, 0)
		local tweenInfo = TweenInfo.new(0.4, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)
		local tween = tweenService:Create(part, tweenInfo, goal)
		script.Parent.correct:Play() --play
		tween:Play()
		task.wait(0.4)
		part:Destroy()
	end
end)
3 Likes

Are you using a local script or server script?

3 Likes

im using a surverscript i dont think thats a problem tho

2 Likes

wheres the serverscript located? like in serverscriptservice or workspace?

3 Likes

Click on the sound “correct” in your Explorer window and in the Properties window click the green play button next to it. You may have set the volume too low.

You are destroying the Part with the sound in it .4 seconds after you Play it.
When you play the sound in the Explorer window does it take more than .4 seconds to play? Some sounds in the toolbox might be a few seconds long, but they are quiet for a short time before making sound when you play them.

3 Likes

If your sound is using a RollOffMode of Enum.RollOffMode.Inverse or Enum.RollOffMode.InverseTapered, make sure your RollOffMinDistance is not 0 (the default being 10, but I’ve noticed that some sounds from the Toolbox have it set to 0): Sounds that are loaded in with MinRollOffDistance set to 0 fail to work as 3D sound - #2 by ReallyLongArms

2 Likes

It doesn’t matter if it’s in workspace or serverscriptservice. This is a server script so it would perform the same in workspace and serverscriptservice.

2 Likes

oh really? when i saw this post i put a script in serverscriptservice with a sound inside of it and tried playing it, it didnt work until i moved it to workspace

2 Likes

A sound has to be inside workspace or soundservice to be played

3 Likes

This could be the issue though because you’re playing the sound from serverscriptservice

3 Likes

yeah thats why i asked if it was in serverscriptservice cause the sound they’re playing is in script.Parent meaning if it is in serverscriptservice it wont play

1 Like

Sounds are played as if they are from that part, so depending on how far away that part is from the camera, the quieter it will become.

2 Likes