I’ve been having some issues with my animation when a weapon is equipped…
Here is the gun and its containings:
And here is the “AnimateHold” script
local plr = game:GetService("Players").LocalPlayer
local anim = script.Parent.Hold
local tool = script.Parent
local animator
local loadedAnims = {}
tool.Equipped:Connect(function(mouse)
animator = plr.Character:WaitForChild("Humanoid"):WaitForChild("Animator")
if not loadedAnims then
loadedAnims = animator:LoadAnimation(anim)
end
loadedAnims:Play()
end)
tool.Unequipped:Connect(function()
loadedAnims:Stop()
end)
The animation creator is set to the same as the game creator so i dont know why this doesnt work
local plr = game:GetService("Players").LocalPlayer
local anim = script.Parent.Hold
local tool = script.Parent
local animator
local loadedAnims = false
tool.Equipped:Connect(function(mouse)
animator = plr.Character:WaitForChild("Humanoid"):WaitForChild("Animator")
if loadedAnims == false then
loadedAnims = plr.Character.Humanoid:LoadAnimation(anim)
end
loadedAnims:Play()
end)
tool.Unequipped:Connect(function()
loadedAnims:Stop()
end)
local plr = game:GetService("Players").LocalPlayer
local anim = script.Parent.Hold
local tool = script.Parent
local animator
local loadedAnims = false
tool.Equipped:Connect(function(mouse)
animator = plr.Character:WaitForChild("Humanoid"):WaitForChild("Animator")
if loadedAnims == false then
loadedAnims = plr.Character.Humanoid:LoadAnimation(anim)
end
loadedAnims:Play()
end)
tool.Unequipped:Connect(function()
loadedAnims:Stop()
end)
Okay, sounds great to me. If it doesn’t work try looking up some tutorials on YouTube. I’m pretty sure AlvinBlox made some pretty good ones that are easy to understand.