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

Why Wont My Animation Play? There is no Errors

Asked by 5 years ago
--| References:
local _Players = game:GetService("Players");
local _ReplicatedStorage = game:GetService("ReplicatedStorage");

local _RemoteEvents = _ReplicatedStorage:WaitForChild("RemoteEvents");
local _DamageEnemyEvent = _RemoteEvents:WaitForChild("DamageEnemy");

local _Player = _Players.LocalPlayer;

local _Tool = script.Parent;
local _Configuration = _Tool:WaitForChild("Configuration");

local _Damage = _Configuration:WaitForChild("Damage");
local _CriticalDamage = _Configuration:WaitForChild("CriticalDamage");

local _Blade = _Tool:WaitForChild("Blade");
local _Animations = _Tool:WaitForChild("Animations");

--| Variables:
local _Equipped = false;
local _Debounce = false;

--| Cached Functions:
local random = math.random;

--| Functions:
local function Clicked()
    if _Equipped and not _Debounce then
        _Debounce = true;
        local _Character = _Tool.Parent;

        --Make a random animation selector
        print(_Character.Humanoid.Name);
        local AnimTrack = _Character.Humanoid:LoadAnimation(_Animations.SwordSlash1);
        AnimTrack:Play();

        wait(0.7);

        _Debounce = false;
    end
end

local function Equipped()
    _Equipped = true;
end

local function Unequipped()
    _Equipped = false;
end

--| Function Connections:
_Tool.Activated:connect(Clicked)
_Tool.Equipped:connect(Equipped);
_Tool.Unequipped:connect(Unequipped);

This script is a local script inside of a tool. When I test it, it doesn't display any errors and so I'm wondering why the animation doesn't play. If anyone can help me out that would be great. Thanks!

0
It has to do with your animations User#19524 175 — 5y
0
I was kind of thinking that, I'll remake the animation. Thanks! isaacsoccer 45 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago

It's most likely your animation as the code is flawless and amazing looking.

Ad

Answer this question