#when press E open inventory error
39 messages · Page 1 of 1 (latest)
Are you not experiencing any errors/warnings, @fallen swift?
where should it be then
It was more of a joke for your terminology. Startergui is a child of "game"
well i am, the gui is always visible when i join the game
right
Maybe disable it before enabling it with the script ._.
tested your script and it works, make sure everything inside the screengui is enabled and visible
did you do the same thing?
I copied your code and partially (only the screengui and added a visible frame into it) copied your gui
make sure all of these are visible when the screengui is enabled
okay enable the screengui
shouldnt be too hard
this happens
when i join the game the gui just gets in the screen instantly
disable it
then try it again
for me it worked like a charm
its better
much better
if i join the game now and i press E then it indeeds opens the inventory
i just have to add an extra line of code that makes it so that it goes away if i press E again
thanks for the help man!
local UserInputService = game:GetService("UserInputService")
local inventorygui = game.Players.LocalPlayer.PlayerGui:WaitForChild("ItemInvGui")-- Reference to the inventory GUI
local eKeyCode = Enum.KeyCode.E
UserInputService.InputBegan:Connect(function(input, isProcessed)
if input.KeyCode == eKeyCode and not isProcessed then
inventorygui.Enabled = not inventorygui.Enabled
end
end)
😉
Booleans are fun
Wait
** You are now Level 4! **
This fixes the open close thingy
makes sense
because it basically says
bool = not bool
so if bool == true then it gets changed to false, and vice versa
scripting can be easy sometimes
in luau? only 20 or so months now
alralr maybe if i put some more effort in this i can make something with this. anyways i need to get some sleep now thanks for everything