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

Gui Open and Close with :GetMouse() ?

script is in StarterGui, doesn't work. No idea why.

Local = game.Players.LocalPlayer
Mouse = Local:GetMouse()
inventory = Local.PlayerGui.Inventory:findFirstChild("InventoryGui")
open = false

function open()
	inventory.Visible = true
end

function close()
	inventory.Visible = false
end

Mouse.KeyDown:connect(function(Key) -- q pressed
	if Key == "q" then
		if open == false then
			x = true
			open()
		else
			x = false
			close()
		end	
	end
end)

2 answers

open = true else open = false

I think I should take a break now...

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