Ok, so first, you may wanna fix your syntax, second, your problem is that when you're saying Tool.Parent.Name
, your refering to Backpack, cuz the parent of the tool is backpack, and backpack is parented to your player, now fixing that should be easy. And btw, one of the biggest issues in your script is tahtyoure using global variables, its recommended to alwyas use local vars, and if they are local you always wanna put them outside of your function, or exaclty your scope, (scope is the content inside your function).
im not sure if you did this or not, but in order for this to work, a part named "Handle" should be parented to your tool.
now this should be your script:
1 | local tool = script.Parent |
2 | local plrname = tool.Parent.Parent.Name |
3 | local plr = game:GetService( "Players" ):FindFirstChild(plrname) |
5 | tool.Equipped:Connect( function () |
6 | tool.Name = plr.AccountAge |
(this was tested and it worked)
so, if i explain again, we made all vars local and outside of the function, always do that, and we fixed the plr.Name, always expiremnt stuff, see if an obj is parented to another, see if somethin is duable... always fo this stuff
https://gyazo.com/cc754edbb2665956c1a7f9c260854ddd
happy to help!