so like my bow animation isn’t working and im using a normal script (not sure if I have to use a local script) and there seem to be no errors
picture of workspace:
local bowanimationr6 = script:WaitForChild("bowanimationr6", 1)
Tool.Activated:Connect(function()
local Character = Tool.Parent
if Character then
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
if Humanoid then
local LoadedAnim = nil
if Humanoid.RigType == Enum.HumanoidRigType.R6 and bowanimationr6 then
LoadedAnim = Humanoid:LoadAnimation(bowanimationr6)
end
if LoadedAnim then
LoadedAnim:Play()
end
end
end
end)
local bowanimationr6 = script:WaitForChild("bowanimationr6")
local Tool = script.Parent
Tool.Activated:Connect(function()
local Character = Tool.Parent
if Character then
local Humanoid = Character:WaitForChild("Humanoid")
if Humanoid then
if Humanoid.RigType == Enum.HumanoidRigType.R6 and bowanimationr6 then
local LoadedAnim = Humanoid:LoadAnimation(bowanimationr6)
repeat
task.wait()
until LoadedAnim.Length > 0
LoadedAnim:Play()
end
end
end
end)
Animation is taken from Devhub.
I made the script a bit different than you but the result are fantastik
Thank @Forummer
Tool hierarchy:
Teh code:
local Tool = script.Parent
local advancedRig = script:WaitForChild("TestAnimationR15")
advancedRig.AnimationId = "rbxassetid://3716468774"
local Indicator = {"Succes!", "Fail"}
local Debounce = true
local function Animate()
local Character = Tool.Parent
if Character then
local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
if Humanoid then
local Loaded = nil
if Debounce == true then
if Humanoid.RigType == Enum.HumanoidRigType.R15 and advancedRig then
Loaded = Humanoid:LoadAnimation(advancedRig)
if Loaded then
Loaded:Play()
print(Indicator[1])
Debounce = false
task.wait(0.8)
Debounce = true
else
print(Indicator[2])
end
end
end
end
end
end
Tool.Activated:Connect(Animate)