local Tool = script.Parent
local call= Tool.callAnim
local idle = Tool.idleAnim
local isFinished = true
local humanoid = Tool.Parent:FindFirstChild("Humanoid")
Tool.Activated:Connect(function()
if isFinished then
isFinished = false
local callAnim= humanoid:LoadAnimation(call)
if callAnim then
local length = callAnim.Length
callAnim:Start()
wait(length)
callAnim:Stop()
else
warn("Call animation not found.")
end
wait(0.3)
isFinished = true
end
end)
Tool.Equipped:Connect(function()
if humanoid then
local idleAnim = humanoid:LoadAnimation(idle)
if idleAnim then
idleAnim:Play()
else
warn("Idle animation not found.")
end
end
end)
Tool.Unequipped:Connect(function()
if humanoid then
local animator = humanoid:FindFirstChild("Animator")
if animator then
animator:StopAllAnimations()
end
end
end)
Hello, I'm just trying out Roblox Studio and I got error message:
Players.rovnone.Backpack.Mobile.LocalScript:11: attempt to index nil with 'LoadAnimation'
Does anyone know how can I fix this issue?
Thanks, Radaros.
** You are now Level 1! **