i have a animaton problem when i press E and release E its doesnt stop playing!
heres a problem!
https://gyazo.com/3fbbc406338947c6c0161638a320c907
server:
game.ReplicatedStorage.CombatEvents.Barrage.OnServerEvent:Connect(function(plr,holding)
local char = plr.Character or plr.CharacterAdded:Wait()
local AnimationCon =char.Stand.AnimationController
--- Animation Track:
----
local stand = char:WaitForChild("Stand")
local candmg
if holding then
candmg = true
elseif not holding then
candmg = false
end
print("A")
local weld = char:WaitForChild("Stand").PrimaryPart.StandController
if holding then
StopAllAnimation(char:WaitForChild("Humanoid"))
local barrage = game.ReplicatedStorage.BarrageAnim
local loadbarrage = AnimationCon:LoadAnimation(barrage)
print(barrage.Parent)
local Action = Instance.new("StringValue")
Action.Name = "ActionValue"
Action.Parent = char
local goal = {}
goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3,1,2))
local info = TweenInfo.new(.5)
local tween = ts:Create(weld,info,goal)
tween:Play()
if tween.Completed:Wait(.1) then
goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(0,-0.75,-2))
local info = TweenInfo.new(.5)
local tween1 = ts:Create(weld,info,goal)
tween1:Play()
--loadbarrage:Play()
loadbarrage:Play()
end
elseif not holding then
StopAllAnimation(char:WaitForChild("Humanoid"))
local goal = {}
goal.C0 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
goal.C1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3,1,2))
local info_1= TweenInfo.new(.5)
local tween2 = ts:Create(weld,info_1,goal)
tween2:Play()
end
end)
Client:
local holding = false
local db = false
uis.InputBegan:Connect(function(input,typing)
holding = true
if not typing and input.KeyCode == Enum.KeyCode.E and db == false then
game.ReplicatedStorage.CombatEvents.Barrage:FireServer(holding)
end
end)
uis.InputEnded:Connect(function(input,typing)
if not typing and input.KeyCode == Enum.KeyCode.E and holding == true then
db = true
holding = false
game.ReplicatedStorage.CombatEvents.Barrage:FireServer(holding)
end
end)