Vehicle seat gui server side sound

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I would like to play a sound through the “SoundPart” by clicking on the button in the following “trim” gui.
    The gui pops up when player sits on the vehicle seat. My problem is that the gui is local to the player only when theyre sitting on the seat… Any help?
    sound
    sound2
    I tried having script.Parent.MouseButton1Down:connect(function() enable a script that plays the audio in the “SoundPart” with no luck.

If I understand you correctly, then you would need to use remote events to let the server know that the player clicked it.

1 Like

What @ifkpop said. You need to fire a remote event to the server in your mousebutton1 function, and then on the server, you need to have a function fire when the remote fires, which plays the sound.

1 Like

this is what @Thr3star is referring to:

-- In a local script
local Remote = game.ReplicatedStorage.AnyName -- change this to the place of your remote event
script.Parent.MouseButton1Down:Connect(function()
Remote:FireServer()
end)

-- In a server script
local Remote = game.ReplicatedStorage.AnyName -- you already know what to change
Remote.OnServerEvent:Connect(function()
-- sound code
end)
1 Like