So I’m still working on my game, and I’m trying to get the tool animations I’ve already made to play for their respective tools. I’ve got the ones for stabbing with the spear and bonking with the hammer to play, but for animations for holding other tools… I can’t get it to work.
Here is my holding animation I want to play for the flashlight:
I am not an expert, but from my understanding, the animation won’t load if it is not inside a function, at least that was my case. Try it and see if it works.
I spent a few minutes thinking about how to order it, and came up with nothing. As I’ve said, scripting is not my strong point… a little more help please?
Hey, here’s a general script for animations when a tool is equipped, this should help you.
local Tool = script.Parent
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local EquipAnim = Tool.Equip
local Equip = Character.Humanoid.Animator:LoadAnimation(EquipAnim)
Tool.Equipped:Connect(function()
Equip:Play()
end)
Tool.Unequipped:Connect(function()
Equip:Stop()
end)
In accordance with my example, it would be a child of the tool, however this shouldn’t matter where you put it, just make sure you path properly in the code.