You could just use FloorMaterial instead of detecting all this sorta stuff…
This also might help
You could just use FloorMaterial instead of detecting all this sorta stuff…
This also might help
Ooh, well can you show me how to do that, literally i’ve just started really trying to script and so far I can only tween
I’ll try it, and look at the links. Lol scripting is confusing.
I insert a humanoid into workspace? Then what? If I’m wrong correct me.
Please notice im not a pro at scripting
It’s ok we all start somewhere xd
Fixed it yet?
Nope, experimenting at the moment, literally I can’t even Tween XD
In a LocalScript, inside of StarterCharacterScripts:
(Code from the link @Lightning_Splash replied with)
local Player = game.Players.LocalPlayer
local Character = Player.Character
local DefaultSound = Character.Head:WaitForChild("Running").SoundId
local MaterialTable = {
[Enum.Material.Grass] = "rbxassetid://256575709"
}
local Assets = {"rbxassetid://256575709","rbxassetid://256575709"}
game:GetService("ContentProvider"):PreloadAsync(Assets)
Character.Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
local FloorMaterial = Character.Humanoid.FloorMaterial
if MaterialTable[FloorMaterial] then
Character.Head.Running.SoundId = MaterialTable[FloorMaterial]
else
Character.Head.Running.SoundId = DefaultSound
end
end)
Hope this helps