Hi! i have a part that contains a string value with the name of a player. When the button is pressed, i want it to clone the tools in the player that pressed its backpack and then put them into the player that has their name in the strvalue. However, im getting: "Attempt to index value nil with "Backpack".". I'm really confused! Please Help!
local nameval = script.Parent.valn
script.Parent.ClickDetector.MouseClick:Connect(function(player)
local val = nameval.Value
local plr = game.Players:FindFirstChild(val)
script.Parent.beep:Play()
for i,v in pairs(player.Backpack:GetChildren()) do
v:Clone().Parent = plr.Backpack
end
if game.ReplicatedStorage.orders.order.Value == 1 then
game.ReplicatedStorage.orders.order.Value = game.ReplicatedStorage.orders.order.Value -1
end
end)
