I need help with this bit of code. I'm trying to make it to where it will equip a tool that is in someone's backpack. I need help finding the player's name and then finding the player's model that way the rest of the script can work.
This is what I have tried but in the output it says "playername is not a valid member of Workspace"
local playername = script.Parent.Parent.Name game.Workspace.playername.Humanoid:EquipTool(script.Parent.Parent.Backpack.STBRifle)
btw this is in a localscript in the StarterGui
game.Workspace[playername].Humanoid:EquipTool(script.Parent.Parent.Backpack.STBRifle)