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

Gui Mouse1Down Help?[SOLVED]

Asked by 9 years ago

Trying to do a gui button but it says that MouseButton1Down is nil when i test it

Player = game.Players.LocalPlayer
Menu = script.Parent
Play = Menu.Parent
Customize = Menu.Customize
Loadout = Menu.Loadout
Stats = Menu.Stats
Info = Menu.Info
Backing = Menu.Backing
CGUI = Menu.CGUI

function C1()
    CGUI.Visable = true
end

function C2()
    CGUI.Visable = false
end

if MouseButton1Down:connect(Customize) then
    C1()
else
    C2()
end

1 answer

Log in to vote
1
Answered by 9 years ago

When you are using a connect statement, you do not put it in an If

Instead of this:

if MouseButton1Down:connect(Customize) then
    C1()

You would need to type this:

Customize.MouseButton1Down:connect(C1)
0
thx rabidhalofan12345 55 — 9y
Ad

Answer this question