Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Same game,Another error,can you help me?(In-NeEd MoDe)

Asked by 4 years ago

Here the ErRoR = 20:30:03.523 - Players.m6xw.Backpack.Weight.Animation:3: attempt to index nil with 'AnimationId'

AnD ThE sCrIpT :

local tool = script.Parent
local anim Instance.new("Animation")
anim.AnimationId = "rbxassetid://4928303202"
local track
tool.Activated:Connect(function()
    track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
    track.Priority = Enum.AnimationPriority.Action
    track.Looped = false
    track:Play()
end)
tool.Unequipped:Connect(function()
    if track then
        track:Stop()
    end
end)
0
;-; Clxud_D 9 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

Hello.


Solution:

You forgot the "=" while making a variable.


Fixed Script:

local tool = script.Parent

local anim = Instance.new("Animation")
anim.AnimationId = "rbxassetid://4928303202"

local track
tool.Activated:Connect(function()
    track = script.Parent.Parent.Humanoid:LoadAnimation(anim)
    track.Priority = Enum.AnimationPriority.Action
    track.Looped = false
    track:Play()
end)
tool.Unequipped:Connect(function()
    if track then
        track:Stop()
    end
end)
0
Thank you Clxud_D 9 — 4y
Ad

Answer this question