Note
If you see any text in blue, it's a line of text you can click to open a link.
Local Scripts
I believe you have been misinformed or you misunderstood what a LocalScript is for. A summary would be the following; a local script is a script that interacts with the Client, not the server.
Server Script
Otherwise known as a regular script is a script that interacts with the Server which those effects transfer to all the clients.
Your Error
As you can see in your script, you contradict your value seat with Line 3 local seat = script.Parent.Parent and Line 6 function onSeated(isSeated, seat), the seat in line 3 is a defined variable, however in Line 6, you turn it into a variable for that function which removes Line 3's purpose.
Your Script
I have not tested this so it may not work,however it's worth the try
TURN THIS INTO A SERVER SCRIPT IF YOU CAN, THERE'S NO REASON FOR IT TO BE A LOCAL SCRIPT.
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")
local seat = script.Parent.Parent
local sound = script.Parent
function onSeated(isSeated)
if isSeated then
seat.sound:Play()
end
end
humanoid.Seated:Connect(onSeated)
5 comments
I dont think you need to use a local script for this purpose. I think this might be the issue, since the local script is only running the sound for the one "client" or player. Try transferring this to a script and try
Because when using a script, the server will ensure all players will be able to see, or hear the change in this instance
Attempt changing this to a Server Script and see if that fixes the issue.
Local script is for a client, you should use a normal script so everyone could hear it. Besides, on line 8, that is 'script.Parent.Parent.script.Parent', that doesn't make sense...
basically, the script is on the sound