Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Attempt to index nil with CharacterAdded?

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.

4 comments

0

You cannot use numbers within variables or function names

0

Yes you can. It jus depends where you place the numbers / characters.

0

That’s disgusting

0

Also, the code that is breaking is the code you didn’t give us.

1 answer

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)

This discussion is preserved as it was. New answers, comments, and votes are closed.