I'm trying to copy/paste a Folder into a Player's inventory using this script. Everything is running fine until I get to making the copied folders parent AllStats on line 22. The problem is because "meme isn't a valid member of Players" even though I've set it up as a variable to be whomever touches the blocks username. Help?

local block = script.Parent

local pressed = false

local function finish(otherPart)

if not pressed then
	
	pressed = true
	
	local points = block:FindFirstChild("Midori Ruins")
	
	local meme = otherPart.Parent.Name

print(points)
print(meme)

local stats = block["Midori Ruins"]

local copy = stats:Clone()

copy.Parent = game.Players.meme.leaderstats.AllStats

wait(1)

	pressed = false

	end

end

block.Touched:Connect(finish)

2 comments

0

You want to use square brackets or FindFirstChild(). e.g. game.Players:FindFirstChild("meme").leader.....

0

Oops, I meant game.Players:FindFirstChild(meme).leader.... no quotes