Sup, I’m making a bar fight simulator that includes a wide range of weapons found in a bar.
Most weapons are melee weapons and I want to give them proper animations for the first time (Like being able to spin the weapon when a key is pressed and something like that).
I already created the animation, but I’m having trouble trying to make it play for the tool.
I did a little digging around the forums and youtube I had no success on trying to make it work.
By the way, I used this tutorial on devforum to try to make this work:
This is the animation:
Equip.wmv (3.0 MB)
This is what happens (By the way the reason there is no toolnone animation is because I changed it to an animation without keyframes):
robloxapp-20230703-1501167.wmv (1.7 MB)
But you get the idea, what’s meant to happen doesn’t happen.
This is the server script I used to try to make this work (It’s the same code block shown in the tutorial but a few more variables and stuff to make the animation play):
local tool = script.Parent
local m6d
local Animation = script:WaitForChild("Animation")
local player = tool.Parent.Parent
local char = player.Character
local EquipAnim = script:WaitForChild("EquipAnim")
local m6d
tool.Equipped:Connect(function(plr)
local a:Weld = char:FindFirstChild("Right Arm"):WaitForChild("RightGrip")
m6d = Instance.new("Motor6D")
m6d.Parent = char:FindFirstChild("Right Arm")
m6d.Name = "RightGrip"
m6d.Part0 = a.Part0
m6d.Part1 = a.Part1
m6d.C0 = a.C0
m6d.C1 = a.C1
local Animation = char.Humanoid:LoadAnimation(EquipAnim)
Animation:Play()
a:Destroy()
end)
tool.Unequipped:Connect(function()
m6d:Destroy()
end)
If any more details are needed then let me know.
Any help is appreciated.