Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Animating Problem, Sword Swing Animation Wont Play When Attacking, am i doing it wrong?

Asked by
LuaDLL 253 Moderation Voter
6 years ago
----- Variables
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Tool = script.Parent
local SwingAnim = Tool:WaitForChild("SwingAnim")
local CanSwing = true

local Settings = {
    SwingTime = 0.5,
    Damage = 15,
}

----- Functions
Tool.Activated:Connect(function()
    if CanSwing then
        print("Activated")
        local Track = Character.Humanoid:LoadAnimation(SwingAnim)
        Track:Play()
        CanSwing = false
        wait(Settings.SwingTime)
        CanSwing = true
    end
end)
0
Make sure you animation is made for the rig (R6 or R15) that you playing it on. That might be the issue, but I don't work with animations much. You could also look up a video online if it still doesn't work. Crazycat4360 115 — 6y
0
It's for R15 and im using R15 LuaDLL 253 — 6y

Answer this question