Sound when proximity prompt is interacted with

Hello everyone!
I want to make a sound play when a proximity prompt is interacted with (so not when it’s triggered).
I want to achieve something like the Fortnite reboot van system. When I’m using a reboot van, i can hear a powerup sound.
I’ve searched multiple script support websites, but without any good result.
How do i do this?

1 Like
game.Workspace.Part.ProximityPrompt.Triggered:Connect(function(player)
   game.SoundService.insertsoundnamehere:Play()
end)

Make sure “.Workspace” is set to wherever your component is, and that the sound is in SoundService unless you modify it.

3 Likes

@RubenHgamer specifically stated that the sound should play when it is interacted with, not triggered.

1 Like

Omg I misread it, my bad. Sorry.

1 Like

To play a sound on interaction, you can write a script that looks something along the lines of this…

local sound = --whatever your sound is

game.Workspace.Part.ProximityPrompt.InputHoldBegin:Connect(function(plr)
     sound:Play()
end)

game.Workspace.Part.ProximityPrompt.InputHoldEnd:Connect(function(plr)
     sound:Stop()
end)
4 Likes

Thank you for the help! I appreciate it a lot!

In case no one offers a proper working solution… you can always just insert the sound into the part and set the roll off distance to the same distance as the prompt… use linear for the sound. Its not a good method, but it is an alternative method.

As i finished this, it looks like @bonkybincer offered up a working solution.

1 Like