I’m trying to play an aiming animation on client side but I’m not sure how to do it, but I know it has something to do with :LoadAnimation, the script below is shortened btw.
local Tool = script.Parent
local AimDown = false
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local Character = workspace:WaitForChild(Player.Name)
local Humanoid = Character:WaitForChild("Humanoid")
local Module = require(Tool:WaitForChild("Setting"))
local Animations = {}
if Module.AimAnimationsEnabled and Module.AimIdleAnimationID ~= nil then
local AimIdleAnimTest = Instance.new("Animation")
AimIdleAnimTest.Name = "AimIdleAnim"
AimIdleAnimTest.AnimationId = "rbxassetid://"..Module.AimIdleAnimationID
AimIdleAnimTest.Parent = Tool
AimIdleAnim = Tool:WaitForChild("AimIdleAnim")
AimIdleAnim = Humanoid:LoadAnimation(AimIdleAnim)
table.insert(Animations, AimIdleAnim)
end
if Module.AimAnimationsEnabled and Module.AimFireAnimationID ~= nil then
local AimFireAnimTest = Instance.new("Animation")
AimFireAnimTest.Name = "AimFireAnim"
AimFireAnimTest.AnimationId = "rbxassetid://"..Module.AimFireAnimationID
AimFireAnimTest.Parent = Tool
AimFireAnim = Tool:WaitForChild("AimFireAnim")
AimFireAnim = Humanoid:LoadAnimation(AimFireAnim)
table.insert(Animations, AimFireAnim)
end