Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would i fix this?

Asked by 8 years ago
    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

0
Try using local on line 6 Validark 1580 — 8y
0
thanks so much! it worked pootlavato567 0 — 8y

Answer this question