Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Play a sound for a local player from a proximity prompt?

Hello, recently I scripted a sound for a proximity prompt (https://gyazo.com/948ebd12694abf44ba75704c7eb02ecb), but this script of course is server side. I'd like it client side, so that only one player will hear the sound once clicked the button of the proximity prompt. I can't script it using a localscript, it doesn't work at all and I also enabled filtering enabled and other stuff on. I can't honestly convert it from server side to client side, can someone help me out?

local proximityPrompt = script.Parent
local sound = script.Sound

proximityPrompt.Triggered:Connect(function()
	sound:Play()
end)

I've also read this topic but I can't understand it. https://developer.roblox.com/en-us/api-reference/function/SoundService/PlayLocalSound

1 comment

0

Well after playing around with some of the beta features, i know how to use this nwo, so you could use remotes, for example, make a local script detect when its triggered, play a sound, then fire a remote.

1 answer

Hey there!

Triggered isn't a function of a Click Detector, Instead use

proximityPrompt.MouseClick:Connect(function()
	sound:Play()
end

I hope this helped, also if this helped could you accept this answer? Thanks!

2 comments

0

Proximity Prompt works like this: https://gyazo.com/d3c4a9b073fb3547ac2795e36933e597,

0

Right, I forgot beta features were a thing, Sorry about that.

This discussion is preserved as it was. New answers, comments, and votes are closed.