Hello,So I am trying to use a clouds effect for when the player runs or jump but it only works when I am not using my custom starter character,let me know what is wrong:
Edit:I found out this doesnt work with r6 only r15 how could I do it work with r6?
local Character = game:GetService("Players").LocalPlayer.Character
local Humanoid: Humanoid = Character:WaitForChild("Humanoid")
local effectLeft, effectRight = script:WaitForChild("CartoonishCloudBack"):Clone(), script:WaitForChild("CartoonishCloudBack"):Clone()
effectLeft.Parent = Character:WaitForChild("LeftFoot"):WaitForChild("LeftAnkleRigAttachment")
effectRight.Parent = Character:WaitForChild("RightFoot"):WaitForChild("RightAnkleRigAttachment")
local effectBottomLeft, effectBottomRight = script:WaitForChild("CartoonishCloudBottom"):Clone(), script:WaitForChild("CartoonishCloudBottom"):Clone()
effectBottomLeft.Parent = Character.LeftFoot.LeftAnkleRigAttachment
effectBottomRight.Parent = Character.RightFoot.RightAnkleRigAttachment
-- Moving, only on the ground
Humanoid.Running:Connect(function(speed: number)
effectLeft.Enabled = speed > 1 and Humanoid.FloorMaterial ~= Enum.Material.Air
effectRight.Enabled = speed > 1 and Humanoid.FloorMaterial ~= Enum.Material.Air
end)
-- Jumping
Humanoid.Jumping:Connect(function(active: boolean)
if active then
for i=1, 2 do
effectBottomLeft:Emit(1)
effectBottomRight:Emit(1)
task.wait(0.02)
end
effectLeft.Enabled = false
effectRight.Enabled = false
end
end)
-- Landing
Humanoid.StateChanged:Connect(function(old, new)
if new == Enum.HumanoidStateType.Landed then
effectBottomLeft:Emit(3)
effectBottomRight:Emit(3)
end
end)