Advertisement
ERROR_CODE

Footsteps

Dec 1st, 2023 (edited)
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.76 KB | None | 0 0
  1. local MaterialSounds =
  2.     {
  3.         [Enum.Material.Grass] = "rbxassetid://507863105",
  4.         [Enum.Material.Metal] = "rbxassetid://944089664",
  5.         [Enum.Material.DiamondPlate] = "rbxassetid://944075408",
  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 = game.Players.LocalPlayer.Character
  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
Add Comment
Please, Sign In to add comment
Advertisement