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

Cannot show GUI on click button. Issues with code or models itself?

Hello. I've been having troubles with making a projector like object, and I don't know what the issue is? Here's a snippit of code for what turns it on.

if game.Workspace.Projector.Buttons.OnButton.On.MouseClick then
	game.Workspace.Projector.Screen.Projector.M1Frame.M1Garand.Visible = true
end

I have click detectors on the button as well.

1 comment

0

This is a ClickDetector or a TextButton?

1 answer

Try this.

MouseClick is a RBLXConnection so use :Connect() to use this.

local debounce = false

game.Workspace.Projector.Buttons.OnButton.On.MouseClick:Connect(function()
	if debounce then
		debounce = false
	else
		debounce = true
	end
	game.Workspace.Projector.Screen.Projector.M1Frame.M1Garand.Visible = debounce
end)

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