local __PLAYER = game:GetService("Players").LocalPlayer
local __HUMANOID = __PLAYER.Character:FindFirstChildOfClass("Humanoid")
__HUMANOID.Changed:Connect(function(Value)
if Value == "MoveDirection" then
if __HUMANOID.MoveDirection.Magnitude <= 0 then
task.spawn(function()
for _,v in script.Parent:GetChildren() do -- Change this to where the particles belong.
if v:IsA("ParticleEmitter") then
v.Enabled = false
end
end
end)
end
end
end)
This effects only the client itself, if you want a server-sided one, you can reply.
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if Humanoid.MoveDirection.Magnitude > 0 then
Character.FootL.AirPuffParticle.Enabled = true
Character.FootR.AirPuffParticle.Enabled = true
else
Character.FootL.AirPuffParticle.Enabled = false
Character.FootR.AirPuffParticle.Enabled = false
end
end)
local __PLAYER = game:GetService("Players").LocalPlayer
local __HUMANOID = __PLAYER.Character:FindFirstChildOfClass("Humanoid")
__HUMANOID.Changed:Connect(function(Value)
if Value == "MoveDirection" then
if __HUMANOID.MoveDirection.Magnitude <= 0 then -- not walkign (opposite of walking, stops) stopping
task.spawn(function()
for _,v in script.Parent:GetDescendants() do
if v:IsA("ParticleEmitter") then
v.Enabled = false
end
end
end)
else -- WALKING ????
task.spawn(function()
for _,v in script.Parent:GetDescendants() do
if v:IsA("ParticleEmitter") then
v.Enabled = true
end
end
end)
end
end
end)
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
Humanoid:GetPropertyChangedSignal("MoveDirection"):Connect(function()
if Humanoid.MoveDirection.Magnitude > 0 then
Character.LeftFoot.AirPuffParticle.Enabled = true
else
Character.LeftFoot.AirPuffParticle.Enabled = false
print("Disabled")
end
end)
hmm its printing I decided to change it and try it on a deffault roblox rig instead of my custom character but then the character couldnt but the particle would only play when i press w which is good