I’m trying to make footstep sounds with animation events and a Remote Event, but im trying to also make the footstep sound play based on the material, but isn’t working.
Local Script at PlayerGUI
game.Players.LocalPlayer.Character.Humanoid.AnimationPlayed:Connect(function(track)
local Material = Humanoid.FloorMaterial
if track.Name == "WalkAnim" then
track:GetMarkerReachedSignal("Step"):Connect(function()
script.RemoteEvent:FireServer(character, Material)
end)
end
end)
Server Script
script.Parent.RemoteEvent.OnServerEvent:Connect(function(Material)
if Material == Enum.Material.DiamondPlate then
script.Parent.Step:Play()
end
end)
it plays the footstep sound, but the sound ignores when it shoud play and just plays it, someone know how to fix?