So I made a simpler post earlier but I guess it didn't answer my question, so I have this script that equips a weapon when you spawn, but the problem is it tries to find something called gun in the backpack but I want it to find the variable that's called gun
local gun = script.Parent.Parent.Backpack:FindFirstChild(script.Value.Value) -- gun
local plr = script.Parent.Parent
local plrname = plr.Name
wait(1)
print(gun) -- to verify it works
local player = game.Workspace:FindFirstChild(plrname)
if player then
if gun then
player.Humanoid:EquipTool(plr.Backpack.gun) -- ERROR IS HERE
end
end

2 comments
Oh ok thanks that worked
Can you label this as the right answer then please.