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

gui script picking is broken?

Asked by 10 years ago
local last = nil
perk = game.StarterGui.ScreenGui.CustomClass.PerksFrame
local Perk1 = {perk.LightWeight, perk.Hardline, perk.Bandoiler, perk.Lethal2, perk.FlakJacket, perk.Ghost}
local Perk2 = {perk.StoppingPower, perk.Juggernaut, perk.SleightofHand, perk.Camouflage, perk.Doubletap}
local Perk3 = {perk.ExtremeConditioning, perk.Recon, perk.Hardened, perk.TacticalMask}
local function turnOrange(new)
    if last ~= nil then
        if new.Name ~= last.Name then
            new.TextColor3 = Color3.new(227, 125, 0)
            last.TextColor3 = Color3.new(235, 235, 235)
        end
    else new.TextColor3 = Color3.new(235, 235, 235)
    end
    last = new
end 

for i, v in pairs(Perk1) do
    v.MouseButton1Down:connect(function()
        turnOrange(v)
    end)
end

for i, v in pairs(Perk2) do
    v.MouseButton1Down:connect(function()
        turnOrange(v)
    end)
end


for i, v in pairs(Perk3) do
    v.MouseButton1Down:connect(function()
        turnOrange(v)
    end)
end



the script doesnt seem to be working, do you know what the problem is, also is there a better way write to the script

Answer this question