Broken script to clone a button for each player

My friend and I are making an ice skating game, neither of us are scripters but due to limited budget we’re trying to figure it out!

Recently we’ve added a ‘judge’ role, and this ui is visible for judges.

We’re trying to create an ‘award medal’ panel, which involves cloning the ‘PlrButton’ in each of the below guis for every player in the server. The red arrow points to the script below

local Players = game:GeService("Players")
local PlrFrame = script.Parent.PlrButton
	local ScrollingFrame = script.Parent
	for index, value in pairs(Players:GetPlayers()) do
	local PlrFrameClone = PlrFrame:Clone()
	PlrFrameClone.Parent = ScrollingFrame
	PlrFrameClone.PlrName.Text = value.Name 
	PlrFrameClone.Name = value.Name
end

We’re stumped at the moment - it looks like it should work but just doesn’t.

Don’t worry about what the actual button does - we’ve got that scripted

Try this code:

If your script is local script use variable: local plr = Players.LocalPlayer
If is server script use variable local plr = script.Parent.Parent (how much parented in GUI)

local Players = game:GeService("Players")
local plr = variable..
local PlrFrame = script.Parent.PlrButton
local ScrollingFrame = script.Parent
local PlrFrameClone = PlrFrame:Clone()
PlrFrameClone.Parent = ScrollingFrame
PlrFrameClone.PlrName.Text = plr.Name 
PlrFrameClone.Name = plr.Name