#when press E open inventory error

39 messages · Page 1 of 1 (latest)

sly nexus
#

How did you manage to get your StarterGui into your workspace?

lethal trail
#

Are you not experiencing any errors/warnings, @fallen swift?

fallen swift
sly nexus
#

It was more of a joke for your terminology. Startergui is a child of "game"

fallen swift
near magnet
sly nexus
# fallen swift right

tested your script and it works, make sure everything inside the screengui is enabled and visible

sly nexus
#

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

fallen swift
#

okay enable the screengui

#

shouldnt be too hard

#

this happens

#

when i join the game the gui just gets in the screen instantly

sly nexus
#

then try it again

fallen swift
#

oki

#

on it

sly nexus
#

for me it worked like a charm

fallen swift
#

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!

sly nexus
# fallen swift much better
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

fallen swift
#

Wait

void marlinBOT
#

studio** You are now Level 4! **studio

fallen swift
#

This fixes the open close thingy

sly nexus
#

yep

#

it basically changes inventorygui.enabled to the other state

fallen swift
#

makes sense

sly nexus
#

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

fallen swift
#

yea im still starting

#

how long have you been scripting for

sly nexus
fallen swift