print("♻️ Loading " .. script.Name .. " : " .. script.ClassName .. " : " .. script.Parent.Name)
-- {{ VARIBLES }}
local M14Tool = script.Parent
local Humanoid = M14Tool.Parent.Parent.Character:WaitForChild("Humanoid")
local Animator = Humanoid.Animator
M14Tool.AnimHandle.Parent = Humanoid.Parent:WaitForChild("RightArm")
-- {{{ ANIMATION INSTANCE VARIBLES }}}
local BoltBackAnimation = script.BoltBack
local InspectionAnimation = script.Inspection
local PortArmsToPresentArmsL = script.PortArmsToPresentArmsL
local PortArmsToPresentArmsR = script.PortArmsToPresentArmsR
local PortArmsToAttentionL = script.PortArmsToPresentArmsL
local PortArmsToAttentionR = script.PortArmsToAttentionR
local PortArmsToLeft = script.PortArmsToLeft
local PortArmsToRight = script.PortArmsToRight
local RightHoldToPortAArms = script.RightHoldToPortArms
local LeftHoldToPortArms = script.LeftHoldToPortArms
-- {{{ CHECK VARIBLES }}}
local animationIsPlaying = false
-- {{ FUNCTIONS }}
local function playAnimation(animation)
if animationIsPlaying then warn("Unable to play user animation for M14. User has animation ongoing") return end
animationIsPlaying = true
print("♻️ Playing animation")
animation:Play()
print("✅ Animation started")
animation.Ended:Connect(function()
animationIsPlaying = false
print("✅ Animation Ended")
end)
end
local function loadAnimation(animationInstance)
print("♻️ Loading Animation : " .. animationID)
return Animator:LoadAnimation(animationInstance)
end
local function setupAnimationVariables()
print("♻️ Loading animations...")
BoltBackAnimation = loadAnimation(BoltBackAnimation)
print("🕛 Loaded Bolt Back")
InspectionAnimation = loadAnimation(InspectionAnimation)
print("🕛 Loaded Inspection")
PortArmsToPresentArmsL = loadAnimation(PortArmsToPresentArmsL)
print("🕛 Loaded Port to Present Left")
PortArmsToPresentArmsR = loadAnimation(PortArmsToPresentArmsR)
print("🕛 Loaded Port to Present Right")
PortArmsToAttentionL = loadAnimation(PortArmsToAttentionL)
print("🕛 Loaded Port to Attention Left")
PortArmsToAttentionR = loadAnimation(PortArmsToAttentionR)
print("🕛 Loaded Port to Attention Right")
PortArmsToLeft = loadAnimation(PortArmsToLeft)
print("🕛 Loaded Port to Left")
PortArmsToRight = loadAnimation(PortArmsToRight)
print("🕛 Loaded Port to Right")
RightHoldToPortAArms = loadAnimation(RightHoldToPortAArms)
print("🕛 Loaded Right to Port")
LeftHoldToPortArms = loadAnimation(LeftHoldToPortArms)
print("🕛 Loaded Left to Port")
print("✅ Loaded animations!")
end
setupAnimationVariables()
M14Tool.Equipped:Connect(function()
print("🎮 Tool : M14 : Equip Function Run")
playAnimation(PortArmsToAttentionR)
print("♻️ Animation started...")
print("♻️ Waiting 5 and playing again")
task.wait(5)
playAnimation(PortArmsToAttentionR)
end)
The rest of the script is not running. I’m really inexpiereced in scripting with tools & animations, I mainly script UI. All help greatly appreciated.