Please, can somoene help. It doesnt work with the animation and I tried many things.
The Problem: When I try to tween it doesnt seem work. I did the animation priority on Movement and Action and boths do not work. Fall or run Animation does still play but I set it to stop whyyy?
local rp = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local Debris = game:GetService("Debris")
local attack = rp:WaitForChild("attack")
local Attackonwall = script.Attackonwall
attack.OnServerEvent:Connect(function(player)
local character = player.Character
local humanoidRP = character:WaitForChild("HumanoidRootPart")
local Humanoid = character:WaitForChild("Humanoid")
local RightHand = character:WaitForChild("RightHand")
local sword = Instance.new("Part")
sword.FormFactor = "Custom"
sword.Shape = Enum.PartType.Block
sword.Material = "Neon"
sword.Name = "RedRayForAttack"
sword.CFrame = humanoidRP.CFrame * CFrame.new(0,-1,-4)
sword.Anchored = true
sword.CanCollide = false
sword.Parent = game.Workspace
sword.Touched:Connect(function(hitted)
local HumanoidRootPart = hitted.Parent:FindFirstChild("HumanoidRootPart")
local HumanoidNPC = hitted.Parent:FindFirstChild("Humanoid")
local EHumanoidP = HumanoidRootPart.Position
local AniamtionPlay = HumanoidNPC:LoadAnimation(Attackonwall)
for _, playingTracks in pairs(HumanoidNPC:GetPlayingAnimationTracks()) do
playingTracks:Stop()
end
HumanoidNPC.WalkSpeed = 0
AniamtionPlay:Play()
local goal = {}
goal.CFrame = CFrame.new(game.Workspace.checkl.Position)
goal.Anchored = true
local tweenPlay = TweenService:Create(HumanoidRootPart, TweenInfo.new(0.1), goal):Play()
wait(5)
HumanoidNPC.WalkSpeed = 16
AniamtionPlay:Stop()
HumanoidRootPart.Anchored = false
end)
end)
Here is all the Animation:
Maybe I need to programm a table?