Script:

script.Parent.MouseButton1Click:connect(function()
	script.Parent.BackgroundColor3 = Color3.new(255,0,0)
	key = game.ServerStorage.RoomKeys.Room1
	clone = key:Clone()
	compuser = game.Workspace.Comp1Plr
	plr = game.Players:FindFirstChild(compuser.Value)
	print("Found Computer User.") --It does print that
	clone.Parent = plr.Backpack
end)

OutPut: Workspace.Comp1.Screen.SurfaceGui.AvailableRooms.Room1.Scri:8: attempt to index global 'plr' (a nil value)

3 comments

2

It most likely is because you did something wrong, and that is not an actual player?

1

I agree with Tempestatem. Your output means that 'plr' is nil.

0

Thanks guys, the player's name was not recorded in the string value thats why, I fixed it now. Thanks!