Hello, there! I was trying to make walking animations for a script I was gonna run in void script builder (place 2), but it's failing to load the walking animations, and is lagging behind. Script:
local punching = false
local lerping = false
local Player = owner
local Character = Player.Character
Character.Animate:Destroy()
Character.Humanoid.Animator:Destroy()
local Torso = Character.Torso
local RootPart = Character.HumanoidRootPart
local RS = Torso["Right Shoulder"]
local LS = Torso["Left Shoulder"]
local RH = Torso["Right Hip"]
local LH = Torso["Left Hip"]
local N = Torso.Neck
local R = Character.HumanoidRootPart.RootJoint
local defRS = RS.C0
local defLS = LS.C0
local defRH = RH.C0
local defLH = LH.C0
local defN = N.C0
local defR = R.C0
local function lerp(th,go)
spawn(function()
--[[
local st = Neck.C0 --// This is the start C0 of the neck
local Go = Neck.C0*CFrame.Angles(math.rad(30,0,0)) --// This is the goal
]]
lerping = true
for i = 0,1,0.1 do --// You can also use for i = 0,1,0.1 too!
th.C0 = th.C0:lerp(go,i)
wait()
end
end)
end
function returntonormal()
lerp(LH,defLH)
lerp(RH,defRH)
lerp(RS,defRS)
lerp(LS,defLS)
lerp(R,defR)
lerp(N,defN)
end
function punch()
if punching == false then
punching = true
lerp(R,defR*CFrame.Angles(0, 0, math.rad(-30.023)))
lerp(LH,defLH*CFrame.Angles(0, math.rad(30.023), 0))
lerp(RS,defRS*CFrame.new(-0.6, 0, 0) * CFrame.Angles(0, 0, math.rad(59.989)))
lerp(LS,defLS*CFrame.Angles(0, 0, math.rad(-75.057)))
lerp(RH,defRH*CFrame.Angles(0, math.rad(-14.897), 0))
for i = 0,1,0.1 do --// You can also use for i = 0,1,0.1 too!
wait()
end
lerp(LH,defLH*CFrame.Angles(0, math.rad(0.115), 0))
lerp(RS,defRS*CFrame.new(1.13, 0, 0) * CFrame.Angles(0, math.rad(30.023), math.rad(90.012)))
lerp(LS,defLS*CFrame.new(0.73, 0, 0) * CFrame.Angles(0, 0, math.rad(-90.126)))
lerp(RH,defRH*CFrame.Angles(0, math.rad(0.115), 0))
lerp(R,defR*CFrame.Angles(0, 0, math.rad(15.011)))
for i = 0,1,0.1 do --// You can also use for i = 0,1,0.1 too!
wait()
end
returntonormal()
punching = false
end
end
local Events = Instance.new("Folder",Player.Character)
Instance.new("RemoteEvent",Events).Name = "Punch"
Events.Punch.OnServerEvent:Connect(function(p)
if p == owner then
punch()
else
p:LoadCharacter()
end
end)
NLS([==[
local Events = script.Parent.Folder
local Player = game:GetService("Players")[script.Parent.Name]
local Mouse = Player:GetMouse()
Mouse.Button1Down:Connect(function()
Events.Punch:FireServer()
end)
]==],Player.Character)
while wait() do
if (RootPart.Velocity.x > 1 or RootPart.Velocity.x < 0 or RootPart.Velocity.z > 1 or RootPart.Velocity.z < 0) and punching == false then
lerp(R,defR*CFrame.Angles(math.rad(30.023), 0, 0))
lerp(LH,defLH*CFrame.new(0.47, 0, 0) * CFrame.Angles(0, 0, math.rad(30.023)))
lerp(RS,defRS*CFrame.Angles(0, 0, math.rad(-60.046)))
lerp(LS,defLS*CFrame.Angles(0, 0, math.rad(-75.057)))
lerp(N,defN*CFrame.Angles(math.rad(-15.011), 0, 0))
lerp(RH,defRH*CFrame.new(0.61, 0, 0) * CFrame.Angles(0, 0, math.rad(29.794)))
for i = 0,1,0.1 do --// You can also use for i = 0,1,0.1 too!
wait()
end
lerp(LH,defLH*CFrame.new(-0.206, 0.39, 0) * CFrame.Angles(0, 0, math.rad(-59.931)))
lerp(RS,defRS*CFrame.Angles(0, 0, math.rad(89.954)))
lerp(LS,defLS*CFrame.Angles(0, 0, math.rad(44.92)))
lerp(N,defN*CFrame.Angles(math.rad(-30.023), 0, 0))
lerp(RH,defRH*CFrame.new(-0.487, 0.06, 0) * CFrame.Angles(0, 0, math.rad(-30.195)))
for i = 0,1,0.1 do --// You can also use for i = 0,1,0.1 too!
wait()
end
else
if punching == false then
if punching == false then
lerp(R,defR*CFrame.new(0, 0, -0.8))
end
if punching == false then
lerp(LH,defLH*CFrame.new(0, 0.79, -0.11) * CFrame.Angles(math.rad(-30.023), 0, 0))
end
if punching == false then
lerp(RS,defRS*CFrame.Angles(math.rad(-30.023), 0, 0))
end
if punching == false then
lerp(LS,defLS*CFrame.Angles(math.rad(-30.023), 0, 0))
end
if punching == false then
lerp(RH,defRH*CFrame.new(0, 0.79, -0.06) * CFrame.Angles(math.rad(-30.023), 0, 0))
end
if punching == false then
for i = 0,1,0.1 do --// You can also use for i = 0,1,0.1 too!
if punching == false then
wait()
end
end
end
if punching == false then
returntonormal()
end
if punching == false then
for i = 0,1,0.1 do --// You can also use for i = 0,1,0.1 too!
if punching == false then
wait()
end
end
end
end
end
end
