The title says it all. But the Tween also doesn’t resize the part.
Here’s my code.
--//Variables//--
local TweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Root = Character:WaitForChild("HumanoidRootPart")
local Humanoid = Character:WaitForChild("Humanoid")
local LeftFoot = Character:WaitForChild("LeftFoot")
local RightFoot = Character:WaitForChild("RightFoot")
local Footstep = Root:WaitForChild("SteppingSound", 30)
----------------------------------------------------
--//Function//--
function onHumanoidRunning(Speed)
if Speed > 6 then
Footstep.Playing = true
local DustPart1 = Instance.new("Part", LeftFoot)
DustPart1.Name = "DP1"
DustPart1.Size = Vector3.new(.75, .5, .75)
DustPart1.Position = LeftFoot.Position
DustPart1.BrickColor = BrickColor.new(255, 255, 255)
DustPart1.Anchored = true
----------------------------------------------------
local DustPart2 = Instance.new("Part", RightFoot)
DustPart1.Name = "DP2"
DustPart2.Size = Vector3.new(.75, .5, .75)
DustPart2.Position = RightFoot.Position
DustPart2.BrickColor = BrickColor.new(255, 255, 255)
DustPart2.Anchored = true
----------------------------------------------------
local TweenInform = TweenInfo.new(0.5, Enum.EasingStyle.Linear, Enum.EasingDirection.In)
local TweenSize1 = TweenService:Create(DustPart1, TweenInform, {Size = Vector3.new(1.25, .75, 1.25), Transparency = 1})
local TweenSize2 = TweenService:Create(DustPart2, TweenInform, {Size = Vector3.new(1.25, .75, 1.25), Transparency = 1})
TweenSize1:Play()
TweenSize2:Play()
task.wait(0.5)
DustPart1:Destroy()
DustPart2:Destroy()
else
Footstep.Playing = false
local DustPart1 = LeftFoot:WaitForChild("DP1")
local DustPart2 = LeftFoot:WaitForChild("DP2")
DustPart1:Destroy()
DustPart2:Destroy()
end
end
function onHumanoidNotRunning()
Footstep.Playing = false
end
--//Connections//--
Humanoid.Running:Connect(onHumanoidRunning)
Humanoid.Jumping:Connect(onHumanoidNotRunning)
Humanoid.FreeFalling:Connect(onHumanoidNotRunning)
Humanoid.Swimming:Connect(onHumanoidNotRunning)