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

Gui Open and Close with :GetMouse() ?

Asked by 10 years ago

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

Log in to vote
0
Answered by 10 years ago

open = true else open = false

I think I should take a break now...

Ad
Log in to vote
0
Answered by 10 years ago

Make it a localscript.

Answer this question