Attempt to index nil with name

I get this error how does that happen? attempt to index nil with name for coins

	local CoinsFolder = Instance.new("Folder")
CoinsFolder.Name = plr.UserId
CoinsFolder.Parent = script

local Coins = Instance.new("NumberValue")
Coins.Name = "Coins"
Coins.Parent = CoinsFolder
Coins.Value = 0

Can you be more specific? Where does it error?
This section of script doesn’t seem to throw an error. Are you sure it’s this section that it errors?

it is that section yes

image

Show me the whole script, So that I can search for the error.

Be more specific, Also. consider demonstrating us the entire script so that we can help you solve your issue.

yes I know but it is a verry long script, I changed the name and then changed it back to that name and it doesn’t show that error anymore. I think it was a bug so thanks all for the comments

1 Like