I can not understand animations and how they work, I need to do that when I hold down the mouse button, the first animation is activated, and then when I pressed down, the second animation is activated. And also that the first animation would stop at the last moment and the humanoid was in a sitting position.
localscript:
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
UIS.InputBegan:Connect(function(inp, gp)
if gp then return end
if inp.UserInputType == Enum.UserInputType.MouseButton1 then
RS.Attack:FireServer("Arg1")
local particle = RS.Particle.Part.Attachment:Clone()
particle.Parent = char.Torso
UIS.InputEnded:Connect(function(inp, gm)
if gm then return end
if inp.UserInputType == Enum.UserInputType.MouseButton1 then
print("End")
RS.Attack:FireServer("Arg2")
particle:Destroy()
end
end)
end
end)
script
local RS = game:GetService("ReplicatedStorage")
local Animation = RS:WaitForChild("Animation")
local Animo1 = Animation:WaitForChild("Animo1")
local Animo2 = Animation:WaitForChild("Animo2")
RS:WaitForChild("Attack").OnServerEvent:Connect(function(plr, arg)
local char = plr.Character
local humanoid = char:WaitForChild("Humanoid")
local Animoo1 = humanoid:LoadAnimation(Animo1)
local Animoo2 = humanoid:LoadAnimation(Animo2)
if arg == "Arg1" then
Animoo1:Play()
elseif arg == "Arg2" then
Animoo2:Play()
end
end)