Attempt to index number with parent?

so i have this super easy script

for i,v in pairs(table1) do
				v.Owner.Value = tool.Parent.Name
			end

which should change owner (a string value) value to tool.Parent.Name (player name)
but i get this error:
image
why is that happening tho?

This is because tool is a number, check what you’re setting it to and make sure its an instance.

Can you show is the part were you define “tool”, as it’s not a object value, a path.

ya sure if my fix that im working on right now wont work then i will show it

image

You can instead using tostring(tool.Parent.Name) so the value can get it and it won’t error an output, i still dont’ know much about it but it could work.

now i get another error which is caused by this:
image

for some reason it doesnt get the lowest branch and its nil

I meant inside the script. As well as that when you call the function.