Would i just do a normal Loadanimation on the players Humanoid?
local Part = --- Local
local Animation = --- Local
Part.Touched:Connect(function()
if Hit.Parent:FindFirstChild("Humanoid") then
Hit.Parent.Humanoid.Animator:LoadAnimation(Animation)
end
end)
Part.Touched:Connect(function(Hit)
if Hit.Character:FindFirstChild("Humanoid") then
Hit.Character:FindFirstChild("Humanoid").Animator:LoadAnimation(Animation)
end
end
Blade.Touched:Connect(function(Hit)
if not DataFolder.Attacking.Value == true then return end
if Hit.Parent:FindFirstChild("Humanoid") then
local head = Hit.Parent.Head
local headPos = Hit.Parent.Head.Position
local ToolPos = Tool:WaitForChild("Hilt").Blade.Position
local left = (head.CFrame*CFrame.Angles(0, math.rad(Distance ), 0)) * CFrame.new(0, 0, -0.1)
local right = (head.CFrame*CFrame.Angles(0, math.rad(-Distance ), 0)) * CFrame.new(0, 0, -0.1)
local fartherLeft = (head.CFrame*CFrame.Angles(0, math.rad(Distance + 0.1), 0)) * CFrame.new(0, 0, -0.1)
local fartherRight = (head.CFrame*CFrame.Angles(0, math.rad(-Distance - 0.1), 0)) * CFrame.new(0, 0, -0.1)
local isInsideAngle = (ToolPos - left.p).Magnitude < (ToolPos - fartherLeft.p).Magnitude and (ToolPos - right.p).Magnitude < (ToolPos - fartherRight.p).Magnitude
local OtherBlade = Hit.Parent:WaitForChild("Lightsaber").Hilt.Blade or Hit.Parent:WaitForChild("Backhand Lightsaber").Hilt.Blade
local Animator = Hit.Parent.Humanoid:FindFirstChild("Animator")
if isInsideAngle and Hit.Parent.Data.Blocking.Value == true then
if DMGDebounce == false then
DMGDebounce = true
--- This is where i placed the LoadAnimation before but all it did was break their functions and animations
Blade.Clash:Play()
OtherBlade.ClashEffects.ClashLight.Enabled = true
OtherBlade.ClashEffects.ClashSparks.Enabled = true
wait(0.1)
OtherBlade.ClashEffects.ClashLight.Enabled = false
OtherBlade.ClashEffects.ClashSparks.Enabled = false
wait(0.4)
DMGDebounce = false
end
else
if DMGDebounce == false then
DMGDebounce = true
Hit.Parent.Humanoid:TakeDamage(DataFolder.Dmg.Value)
Blade["Hit" .. math.random(1,4)]:Play()
wait(0.4)
DMGDebounce = false
end
end
end
end)
Are you asking about an error or if it’s just a good way to load animations? if you’re asking about loading, I think this is pretty solid, you can just load in the animations directly from humanoid/animator upon character’s creation, but I think this is better.
Loading into the Humanoid Is Deprecated, I was just wondering if i was loading it in correctly, but i am im gonna look into other things that could be breaking my functions.