Advertisement
Drvays

Footstep Sounds

Jul 4th, 2022
120,241
8
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 8 0
  1. local MaterialSounds =
  2. {
  3. [Enum.Material.Grass] = "rbxassetid://507863105",
  4. [Enum.Material.Metal] = "rbxassetid://944089664",
  5. [Enum.Material.DiamondPlate] = "rbxassetid://944089664",
  6. [Enum.Material.Pebble] = "rbxassetid://944090255",
  7. [Enum.Material.Wood] = "rbxassetid://944075408",
  8. [Enum.Material.WoodPlanks] = "rbxassetid://944075408",
  9. [Enum.Material.Plastic] = "rbxassetid://944075408",
  10. [Enum.Material.SmoothPlastic] = "rbxassetid://944075408",
  11. [Enum.Material.Sand] = "rbxassetid://944090255",
  12. [Enum.Material.Brick] = "rbxassetid://4981969796",
  13. [Enum.Material.Cobblestone] = "rbxassetid://4981969796",
  14. [Enum.Material.Concrete] = "rbxassetid://944075408",
  15. [Enum.Material.CorrodedMetal] = "rbxassetid://4981969796",
  16. [Enum.Material.Fabric] = "rbxassetid://4981969796",
  17. [Enum.Material.Foil] = "rbxassetid://4981969796",
  18. [Enum.Material.ForceField] = "rbxassetid://4981969796",
  19. [Enum.Material.Glass] = "rbxassetid://944075408",
  20. [Enum.Material.Granite] = "rbxassetid://944075408",
  21. [Enum.Material.Ice] = "rbxassetid://4981969796",
  22. [Enum.Material.Marble] = "rbxassetid://944075408",
  23. [Enum.Material.Neon] = "rbxassetid://4981969796",
  24. [Enum.Material.Slate] = "rbxassetid://944075408",
  25. }
  26.  
  27. local Character = script.Parent
  28. local Humanoid = Character:WaitForChild("Humanoid")
  29. local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
  30. local FootStepsSound = HumanoidRootPart:WaitForChild("Running")
  31.  
  32. Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
  33. local FloorMaterial = Humanoid.FloorMaterial
  34. local Sound = MaterialSounds[FloorMaterial]
  35. if Sound then
  36. FootStepsSound.SoundId = Sound
  37. else
  38. FootStepsSound.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3"
  39. end
  40. end)
Advertisement
Comments
  • # text 0.00 KB | 0 0
    1. ty
    2.  
  • idkimainarbiter
    276 days
    # text 0.27 KB | 0 0
    1. works very well but needs some more materials, but you can add them by just doing [Enum.Material.[material you want] = "rbxassetid://[the id of the audio you want]
    2.  
    3. same to edit already existing ones, just replace the id after "rbxassetid://XXXXXXXX" with the one you want
Add Comment
Please, Sign In to add comment
Advertisement