This is the code I’ve got so far. I know its messy but just bare with me.
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Humanoid = script.Parent.Parent:WaitForChild("Humanoid")
local s = script
local RootPart = Player.Character.HumanoidRootPart
local Animating = false
local Attacking = false
local Animdict = {
[1] = s:WaitForChild("Animation1"),
[2] = s:WaitForChild("Animation2"),
[3] = s:WaitForChild("Animation3"),
[4] = s:WaitForChild("Animation4"),
[5] = s:WaitForChild("IdleAttacking"),
}
local CURRENTVAL = Instance.new("NumberValue", s)
CURRENTVAL.Value = 1
local Animating = false
Mouse.Button1Down:Connect(function()
if not Attacking then
Attacking = true
Humanoid:LoadAnimation(Animdict[5]):Play()
end
if not Animating then
Animating = true
Humanoid.JumpPower = 0
Humanoid:LoadAnimation(Animdict[CURRENTVAL.Value]):Play()
--//Movement
BV = Instance.new("BodyVelocity", RootPart)
BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
BV.Velocity = RootPart.CFrame.lookVector.Unit * 4
--// Sound Effects
swing = Instance.new("Sound",RootPart)
swing.SoundId = "rbxassetid://4374877983"
swing.PlaybackSpeed = 2
swing:Play()
swing.TimePosition = 0.1000000000000000111
CURRENTVAL.Value = CURRENTVAL.Value + 1
if CURRENTVAL.Value > 2 then
CURRENTVAL.Value = 1
end
if CURRENTVAL.Value == 1 then
wait(.33)
elseif CURRENTVAL.Value == 2 then
wait(.33)
elseif CURRENTVAL.Value == 3 then
wait(.33)
elseif CURRENTVAL.Value == 4 then
wait(.33)
end
Animating = false
BV:Destroy()
swing:Stop()
swing:Destroy()
end
end)
I saw this- How would I go about creating animation combos for melee weapons? - #6 by EmeraldSlash but I do not know how I’d add this to my current script
Here’s a quick demo of what it currently does :
Any help would be greatly appreciated!