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

Attempt to index nil with CharacterAdded?

Asked by 4 years ago
Edited 4 years ago

I keep getting this error on line 6, "Attempt to index nil with 'Character' Anything I'm doing wrong? (This is a SCP-096 Script) Link To Full Script: https://paste.ee/r/dtVtk/0

function load096Char()
print("Had to remove most of the script since it was over 10,000 characters, the problem is, The player's character is nil")
end

wait(1)
game.Players.LocalPlayer.CharacterAdded:Wait()
game.Players.LocalPlayer.Character=load096Char()


Had to cut down most of the script since it was over 10,000 characters.

0
You cannot use numbers within variables or function names Ziffixture 6913 — 4y
0
Yes you can. It jus depends where you place the numbers / characters. EpicMetatableMoment 1444 — 4y
0
That’s disgusting Ziffixture 6913 — 4y
0
Also, the code that is breaking is the code you didn’t give us. Ziffixture 6913 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

It seems that you think :Wait() is a command(did you mean :WaitForChild() Try:

game:GetService("Players").PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
char = load096Char()
end)
end)
Ad

Answer this question