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

How do i fix this? Animation + Tool the error im getting is attempt to index nil with 'Parent' [closed]

Asked by 4 years ago
Edited by JesseSong 4 years ago

Please encode Lua code in the Lua block code tag (look for the Lua icon in the editor).

in case you cant copy here is raw paste https://pastebin.com/raw/6jC7hnzn Edited

01local tool = script.Parent
02local Players = game:GetService("Players")
03local player = Players.LocalPlayer
04local character = player.Character
05while character.Parent == nil do
06    character.AncestryChanged:Wait()
07end
08local leaderstats = player.leaderstats
09local cooldown = 2
10local ready = true
11local humanoid = character:WaitForChild("Humanoid")
12local animation = tool.Animation
13local animationTrack = humanoid:LoadAnimation(animation)
14 
15 
View all 30 lines...

Don't ever delete what a moderator has added on your question, or it will get moderated!

Error: attempt to index nil with 'Parent

[Edit by JesseSong:] Tip use a codeblock when answering questions, as it makes it easier and legible for us to read.

0
in case you cant copy here is raw paste https://pastebin.com/raw/6jC7hnzn PurpleSouley1234 43 — 4y
0
Try inputting this line of code after you declare the character variable: https_KingPie 0 — 4y
0
test https_KingPie 0 — 4y
0
(Having trouble getting the formatting down - try pasting this code block right after you declare the variable "character" https://pastebin.com/raw/kb0dXH8N https_KingPie 0 — 4y
View all comments (2 more)
0
it doesn't give me error anymore but animation wont play PurpleSouley1234 43 — 4y
0
nvm it sill gives me the same error PurpleSouley1234 43 — 4y

Closed as Non-Descriptive by JesseSong

This question has been closed because its title or content does not adequately describe the problem you are trying to solve.
Please ensure that your question pertains to your actual problem, rather than your attempted solution. That is, you were trying to solve problem X, and you thought solution Y would work, but instead of asking about X when you ran into trouble, you asked about Y.

Why was this question closed?