Sound effect Problem


3A8A8577-30EB-46BE-A09A-EBF8F3086301_4_5005_c

Hi, I have been having trouble on the sound effect where it is not playing, I have checked the sound and try medthods on this script but nothing works as planned. If you are wondering I was trying to make a script where when the proximity prompts is triggered it would make a sound effect. In other words it like a switch that makes sound effect every time it clicked. Please help me I am not a great scripture.

1 Like

Why do you have to make a new sound effect every time. Just add a sound effect to “Bulb”.

brb afk sorry

That doest work for me im not sure

Try adding sound.Volume = 0.5, why don’t you just put the sound into the bulb, I don’t see why its necessary to create a new sound every time.

On the second script, you are trying to use the ‘Triggered’ function on a part instance.

you should copy the ProximityPrompt variable from your other script, and do

ProximityPrompt.Triggerd

not

bulb.Triggered

it should look something like this

local bulb = script.Parent.Bulb
local sound = Instance.new("Sound")
local promt = bulb.ProximityPrompt -- Add this variable

sound.SoundId = '' -- Insert SoundId
sound.Parent = bulb

promt.Triggered:Connect(function() -- make the ProximityPrompt use the .Triggered function instead of the part instance
	sound:Play(1)
end)
1 Like

Thanks work out very well and play as you expected