Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I change ROBLOX player walk sound when he steps on two types of terrain material?

Asked by
proo34 41
6 years ago

I have two sounds that I want to play when a player walks on the terrain of a forest. I want a stone sound to play on the stone material and a grass sound on the grass. I've been trying but the sound is sped up and normally doesn't load sometimes.

--Sound Names

--STONE: StoneWalk:Play() --GRASS: GrassWalk:Play()

thanks!

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

so, you cant necessarily play it specifically on the terrain, but you can add a block around the terrain, and if the player touches it, it plays the sound.

script.Parent.Touched:Connect(function(hit)
if hit,Parent = Humanoid then
local sound = script:WaitForChild("YOUR SOUND") --MUST BE LOCAL SCRIPT
while true do
sound:Play()
wait(1)
            end
      end
end)
script.Parent.TouchEnded:Connect(function()
sound:Stop() -- stop might be wrong, you can search it up
end)
0
you can do the same with the rock, just make a different part natonator63 29 — 6y
0
line #2 is incorrect | please indent green271 635 — 6y
0
just place a dot where the "," is Paintertable 171 — 6y
0
Hey can you do this when a car drives on a certain material such as a concrete sound? u know.. that loud noise when ur on a highway. Is there anyway it can get a higher pitch as the car increases speed? thanks Broheims 0 — 4y
Ad

Answer this question