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

Need help on a GUI script?

Asked by 10 years ago

When i open loadout multiple ones are supposed to open but they dont. I have L1, L2, L3, L4, L5, L6 but they dont pop up with loadout. Sorry of this isnt well explained. I get this error "Players.Player1.PlayerGui.ScreenGui.LocalScript:92: attempt to index global 'L1' (a function value)"

Player = game.Players.LocalPlayer
Menu = script.Parent
Play = Menu.Play
Customize = Menu.Customize
Loadout = Menu.Loadout
Stats = Menu.Stats
Help = Menu.Help
Controls = Menu.Controls
Backing = Menu.Backing
CGUI = Menu.CGUI
CGUIX = Menu.CX
LGUI=Menu.LGUI
LGUI2=Menu.LGUI2
LGUIX=Menu.LX
SGUI=Menu.SGUI
SGUIX=Menu.SX
HGUI=Menu.HGUI
HGUIX=Menu.HX
COGUI=Menu.COGUI
COGUIX=Menu.COX
L1=Menu.L1
L2=Menu.L2
L3=Menu.L3
L4=Menu.L4
L5=Menu.L5
L6=Menu.L6

function C1()
    CGUI.Visible = true
    CGUIX.Visible = true
    LGUI.Visible = false
    LGUIX.Visible = false
    SGUI.Visible = false
    SGUIX.Visible = false
    HGUIX.Visible = false
    HGUI.Visible = false
    COGUIX.Visible = false
    COGUI.Visible = false
    L1.Visible = false
    L2.Visible = false
    L3.Visible = false
    L4.Visible = false
    L5.Visible = false
    L6.Visible = false
    LGUI2.Visible=false
end

function C2()
    CGUI.Visible = false
    CGUIX.Visible = false
    LGUI.Visible = false
    LGUIX.Visible = false
    SGUI.Visible = false
    SGUIX.Visible = false
    HGUIX.Visible = false
    HGUI.Visible = false
    COGUIX.Visible = false
    COGUI.Visible = false
end

function L1()
    LGUI.Visible = true
    LGUIX.Visible = true
    CGUI.Visible = false
    CGUIX.Visible = false
    SGUI.Visible = false
    SGUIX.Visible = false
    HGUIX.Visible = false
    HGUI.Visible = false
    COGUIX.Visible = false
    COGUI.Visible = false
    L1.Visible = true
    L2.Visible = true
    L3.Visible = true
    L4.Visible = true
    L5.Visible = true
    L6.Visible = true
    LGUI2.Visible=true
end

function L2()
    LGUI.Visible = false
    LGUIX.Visible = false
    CGUI.Visible = false
    CGUIX.Visible = false
    SGUI.Visible = false
    SGUIX.Visible = false
    HGUIX.Visible = false
    HGUI.Visible = false
    L1.Visible = false
    L2.Visible = false
    L3.Visible = false
    L4.Visible = false
    L5.Visible = false
    L6.Visible = false
end

function S1()
    SGUI.Visible = true
    SGUIX.Visible = true
    LGUI.Visible = false
    LGUIX.Visible = false
    CGUI.Visible = false
    CGUIX.Visible = false
    HGUIX.Visible = false
    HGUI.Visible = false
    COGUIX.Visible = false
    COGUI.Visible = false
    L1.Visible = false
    L2.Visible = false
    L3.Visible = false
    L4.Visible = false
    L5.Visible = false
    L6.Visible = false
    LGUI2.Visible=false
end

function S2()
    SGUI.Visible = false
    SGUIX.Visible = false
    LGUI.Visible = false
    LGUIX.Visible = false
    CGUI.Visible = false
    CGUIX.Visible = false
    HGUIX.Visible = false
    HGUI.Visible = false
end

function H1()
    HGUI.Visible = true
    HGUIX.Visible = true
    LGUI.Visible = false
    LGUIX.Visible = false
    SGUI.Visible = false
    SGUIX.Visible = false
    CGUIX.Visible = false
    CGUI.Visible = false
    COGUIX.Visible = false
    COGUI.Visible = false
    L1.Visible = false
    L2.Visible = false
    L3.Visible = false
    L4.Visible = false
    L5.Visible = false
    L6.Visible = false
    LGUI2.Visible=false
end

function H2()
    HGUI.Visible = false
    HGUIX.Visible = false
    LGUI.Visible = false
    LGUIX.Visible = false
    SGUI.Visible = false
    SGUIX.Visible = false
    CGUIX.Visible = false
    CGUI.Visible = false
end

function CO1()
    COGUI.Visible = true
    COGUIX.Visible = true
    LGUI.Visible = false
    LGUIX.Visible = false
    SGUI.Visible = false
    SGUIX.Visible = false
    CGUIX.Visible = false
    CGUI.Visible = false
    HGUIX.Visible = false
    HGUI.Visible = false
    L1.Visible = false
    L2.Visible = false
    L3.Visible = false
    L4.Visible = false
    L5.Visible = false
    L6.Visible = false
    LGUI2.Visible=false
end

function CO2()
    COGUI.Visible = true
    COGUIX.Visible = true
    LGUI.Visible = false
    LGUIX.Visible = false
    SGUI.Visible = false
    SGUIX.Visible = false
    CGUIX.Visible = false
    CGUI.Visible = false
    HGUIX.Visible = false
    HGUI.Visible = false
end

function P1()
    Menu:ClearAllChildren()
end

Customize.MouseButton1Down:connect(C1)
CGUIX.MouseButton1Down:connect(C2)
Loadout.MouseButton1Down:connect(L1)
LGUIX.MouseButton1Down:connect(L2)
Stats.MouseButton1Down:connect(S1)
SGUIX.MouseButton1Down:connect(S2)
Help.MouseButton1Down:connect(H1)
HGUIX.MouseButton1Down:connect(H2)
Play.MouseButton1Down:connect(P1)
Controls.MouseButton1Down:connect(CO1)
COGUIX.MouseButton1Down:connect(CO2)

Answer this question