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!
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.
01 | script.Parent.Touched:Connect( function (hit) |
02 | if hit,Parent = Humanoid then |
03 | local sound = script:WaitForChild( "YOUR SOUND" ) --MUST BE LOCAL SCRIPT |
04 | while true do |
05 | sound:Play() |
06 | wait( 1 ) |
07 | end |
08 | end |
09 | end ) |
10 | script.Parent.TouchEnded:Connect( function () |
11 | sound:Stop() -- stop might be wrong, you can search it up |
12 | end ) |