I'm trying to make a script that locally changes the audio volume if you touch a brick the title is the output in the server when i try to make the script run
server script in the brick
local remote = game.ReplicatedStorage.sounderemote
local players = game:GetService("Players")
script.Parent.Touched:Connect(function(hit)
local plr = players:GetPlayerFromCharacter(hit.Parent)
if plr then
remote:FireClient(plr)
end
end)
local script inside of sound in playergui
local remote = game.ReplicatedStorage.sounderemote
remote.OnClientEvent:Connect(function()
script.Parent.Volume=.1
end)

5 comments
hit.Parent is a Character , It's like 'game.Workspace.retracee.LeftLeg'. You could get playerFromChar
What..? ^ He did that.
Are you positive this script is erroring on line 7 (Server)? You are definitely passing the player as the first argument
Oppsss, mybad . line 7: end is an enclosing the 'if' condition . Player is required for it
yes it says in the logs on the server error line 6