Yesterday I was working on a inventory script but for some reason couldn’t get it to open even though everything seems right. the only thing I could think that could be wrong is me trying to set it to visible instead of doing some other way but this is the only way I could imagine it.
If anybody with expierance with these types of scripts could tell me what I did wrong I would highly appreciate!
Btw this script is located in StarterPlayerScripts
game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.Tab then
game.StarterGui.ScreenGui.Inventory.Visible = true
end
end)
I belive you may be missing some parts of the code: Here is the developer hub form for UIS (Scroll all the way to the bottom for an example.)
Looking at the form, and from personal experience, most of the UIS Keycodes I’ve seen are a little bit longer
Yeah, Player GUI is specific to players and Starter Guis are available to everyone. So, with StarterGui, when one person pressed tab, everyones inventory would open in a Server Script
local invVisible = game.Players.LocalPlayer.PlayerGui.ScreenGui.Inventory.Visible
game:GetService("UserInputService").InputBegan:Connect(function(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.Tab then
if invVisible == false then
invVisible = true
else invVisible = false
end
end
end)