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

How do I make a Animation Play in my script error: attempt to index nil with 'Humanoid' ?

Asked by 4 years ago
Edited 4 years ago

Thanks for reading Please help me fix it the animation part is falling

01local debounce = false
02local player = game.Players.LocalPlayer
03local mouse = player:GetMouse()
04local torso = workspace:FindFirstChild(player.Name)
05mouse.KeyDown:connect(function(key)
06    if key == "q" then
07        if not debounce then
08            debounce = true
09            local part = game.ReplicatedStorage.Part:Clone()
10            local part2 = game.ReplicatedStorage.Part:Clone()
11            local part3 = game.ReplicatedStorage.Part:Clone()
12            local Icep = game.ReplicatedStorage.Icep:Clone()
13            local anim = torso.Humanoid:LoadAnimation(game.Workspace.Anim)
14            wait(1)
15            Icep.Parent = game.Workspace
View all 30 lines...

1 answer

Log in to vote
0
Answered by 4 years ago
01local debounce = false
02local player = game.Players.LocalPlayer
03local mouse = player:GetMouse()
04repeat wait() until player.Character
05local torso = player.Character
06mouse.KeyDown:connect(function(key)
07    if key == "q" then
08        if not debounce then
09            debounce = true
10            local part = game.ReplicatedStorage.Part:Clone()
11            local part2 = game.ReplicatedStorage.Part:Clone()
12            local part3 = game.ReplicatedStorage.Part:Clone()
13            local Icep = game.ReplicatedStorage.Icep:Clone()
14            local anim = torso.Humanoid:LoadAnimation(game.Workspace.Anim)
15            wait(1)
View all 31 lines...

you had some spelling problems for example you typed Positiona instead of Position. Try this and if it gives error, tell me it

0
Players.robot7866.PlayerScripts.LocalScript:13: attempt to index nil with 'Humanoid' robot7866 36 — 4y
Ad

Answer this question