Hello! I am trying to understand why a remotevent meant to send sounds in a players character returns the character and player objects? Ive attempted to change the order and names of the info sent from the event in the serverscript.
LocalScript
local player = game:GetService("Players").LocalPlayer
local char = player.Character
for x, sound in pairs(char:WaitForChild('HumanoidRootPart'):GetChildren()) do
if sound:IsA("Sound") then
if sound.Name == 'Jumping' then
game:GetService("ReplicatedStorage"):WaitForChild("remotes"):WaitForChild("sound"):FireServer(sound,true)
else
game:GetService("ReplicatedStorage"):WaitForChild("remotes"):WaitForChild("sound"):FireServer(sound,false)
end
end
end
ServerScript
game:GetService("ReplicatedStorage"):WaitForChild("remotes"):WaitForChild("sound").OnServerEvent:Connect(function(el,sound)
if sound == true then
el.Volume = 4
el.SoundId = 'rbxassetid://779912379'
else
print(el:GetFullName())
el:Destroy()
end
end)