Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Gui Mouse1Down Help?[SOLVED]

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

✓ Accepted answer

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)

1 comment

0

thx

This discussion is preserved as it was. New answers, comments, and votes are closed.