local nom1 = game.Lighting.Nom1
	local nom2 = game.Lighting.Nom2
	local name = 1
	local nom1clone = nom1:clone()
	for i = 1, #players do
		templateclone = template:clone()
		templateclone.Parent = game.Players.Player.PlayerGui.NominationGUI
		templateclone.Position = UDim2.new(0.5, -100, num, 0)
		templateclone.Name = players[i].Name
		templateclone.Text = players[i].Name
		num = num +0.1
		name = name +1
		local function onClicked()
			nom1clone.Parent = game.Players.Player.PlayerGui.NominationGUI
			nom1clone.Text = templateclone.Text
		end
		templateclone.MouseButton1Click:connect(onClicked)
	end

Okay, so this creates a list of clickable buttons, each has a name of player who's on the server. The name of the buttons are the names of the players, so on the onClicked() function, how would i change it so that nom1clone.Text = the name of the clicked button's text, because if i put

nom1clone.Text = templateclone.Text

nom1clone's text will be the same thing, no matter what i click

2 comments

0

Try using local on line 6

0

thanks so much! it worked