Hello today i want to make it so when the player walks on sand or some other material a particle emitter activates and deactivates when stepped on grass for example. I think to spawn it i might i have to use instance.new but idk. I know how to do most of this i think here is what i have so far, the script will be in startercharacterscripts.
wait(5)
local chara = script.Parent:FindFirstChild("Humanoid")
script.Parent.LeftFoot.ParticlePart.Enabled = false
script.Parent.RightFoot.ParticlePart.Enabled = false
--Creating of the Parts and ParticleEmitter here i think
if chara.FloorMaterial == Enum.Material.Sand then
script.Parent.LeftFoot.ParticlePart.Enabled = true
script.Parent.RightFoot.ParticlePart.Enabled = true
elseif chara.FloorMaterial == Enum.Material.Grass then
script.Parent.LeftFoot.ParticlePart.Enabled = false
script.Parent.RightFoot.ParticlePart.Enabled = false
end
i have no idea where the check if player is stationary part goes