How to fix this remotevent script you can explain me too what was wrong
local ReplicatedStorage = game:GetService("ReplicatedStorage") local vd = ReplicatedStorage:WaitForChild("volumedown") script.Parent.MouseButton1Click:connect(function() vd:FireAllClients() end)
local ReplicatedStorage = game:GetService("ReplicatedStorage") local vd = ReplicatedStorage:WaitForChild("volumedown") vd.Name = volumed vd.OnClientEvent:Connect(function() game.Workspace.Audio.Volume = game.Workspace.Audio.Volume -0.1 end)
(im trying to make a volume down button)
I'm guessing you're trying to make the volume go down for EVERYONE. In this case, OnClientEvent is not the way to go. You should be using FireServer and OnServerEvent instead.
Server-side is the game and the things that are visible to all clients. Client-side is the individual's device, and the things only visible to that player. For example, a GUI is client-side because only that player can see it on their screen. As for a baseplate in the workspace is server-side, because all clients can interact with it.
So if you need everyone to hear the volume change, you need to fire the server, since it's server-side.
Here's what it should look like (make sure the second block of code is in a normal script).
local ReplicatedStorage = game:GetService("ReplicatedStorage") local vd = ReplicatedStorage:WaitForChild("volumedown") script.Parent.MouseButton1Click:connect(function() vd:FireServer() end)
local ReplicatedStorage = game:GetService("ReplicatedStorage") local vd = ReplicatedStorage:WaitForChild("volumedown") vd.Name = volumed vd.OnServerEvent:Connect(function() game.Workspace.Audio.Volume = game.Workspace.Audio.Volume -0.1 end)