Hi, I am making a horror game but because I have set the player to be stuck in first person mode, I needed to keybind the 'controls' and 'updates' GUI's in StarterGUI area. The issue I am having is that, when both are keybinded to separate keys - one of them is keybinded to U and the other to O - neither of the scripts work, but when only one of them is binded, that script works perfectly. Basically, I am trying to make a main menu with CONTROLS and UPDATES pop-up GUIs binded with keys U and O. Can anyone help or is it just meant to be only one can work?
#Main Menu Gui help pls
464 messages · Page 1 of 1 (latest)
This is the script I am using for the GUI:
`local toggle = false -- false is Off; true is On
function onKeyPress(actionName, userInputState, inputObject)
if userInputState == Enum.UserInputState.Begin then
print("U was pressed")
if toggle == false then
toggle = true
script.Parent.Visible = false
script.Parent.Parent.TextButton.Visible = false
script.Parent.Parent.UpdateLog.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo1.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo2.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo3.Visible = true
script.Parent.Parent.UpdateLog.ViewportFrame.Visible = true
script.Parent.Parent.CONTROLS.Visible = false
else
toggle = false
script.Parent.Visible = true
script.Parent.Parent.TextButton.Visible = true
script.Parent.Parent.UpdateLog.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo1.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo2.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo3.Visible = false
script.Parent.Parent.UpdateLog.ViewportFrame.Visible = false
script.Parent.Parent.CONTROLS.Visible = true
end
end
end
game.ContextActionService:BindAction("keyPress", onKeyPress, false, Enum.KeyCode.U)`
Main Menu Gui help pls
i dont have much knowledge with cas
In a local script, use "UserInputService"
local UI = game:GetService("UserInputService")
And now whenever the player press the a key it will check if the key is X and do the task
UI.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.E then
--Open/close gui
end
end)
Also, here you can create a "Frame" that contains all this and turn only that visible on/off
UI.InputBegan:Connect(function(input, istyping)
if istyping then return end
if input.KeyCode == Enum.KeyCode.E then
--Open/close gui
end
end)```
if u want it to not do it while typing theres a fix
so where would i put this stuff?
ive only been doing roblox studio scripting for about a week
singleplayer only game - the typing wont be an issue, but tysm 😄
so like this?
** You are now Level 1! **
local UI = game:GetService("UserInputService")
UI.InputBegan:Connect(function(O)
if key.KeyCode == Enum.KeyCode.O then
script.Parent.Visible = false
script.Parent.Parent.TextButton.Visible = false
script.Parent.Parent.Updates.Visible = false
script.Parent.Parent.controls.Visible = true
script.Parent.Parent.controls.frame1.Visible = true
script.Parent.Parent.controls.control1.Visible = true
script.Parent.Parent.controls.control2.Visible = true
script.Parent.Parent.controls.control3.Visible = true
else
script.Parent.Visible = true
script.Parent.Parent.TextButton.Visible = true
script.Parent.Parent.Updates.Visible = true
script.Parent.Parent.controls.Visible = false
script.Parent.Parent.controls.frame1.Visible = false
script.Parent.Parent.controls.control1.Visible = false
script.Parent.Parent.controls.control2.Visible = false
script.Parent.Parent.controls.control3.Visible = false
end
end)
ok i just realised i was supposed to put 'key' and not 'o' - it works now
but now how do i make it so that when you press 'o' again, it does the opposite? as in, it reverts ?
both of them work now, but only one of them makes the 'PLAY', 'CONTROLS' and 'UPDATES' buttons disappear..? any way to fix this too?
N
(i want both of them to make the buttons disappear until their keybind is pressed again.. any ideas?
Whats
?
What do you need to fix
ok so now it half works
so heres the script i am using
local UI = game:GetService("UserInputService")
UI.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.U then
script.Parent.Visible = false
script.Parent.Parent.TextButton.Visible = false
script.Parent.Parent.UpdateLog.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo1.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo2.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo3.Visible = true
script.Parent.Parent.UpdateLog.ViewportFrame.Visible = true
script.Parent.Parent.CONTROLS.Visible = false
else
script.Parent.Visible = true
script.Parent.Parent.TextButton.Visible = true
script.Parent.Parent.UpdateLog.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo1.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo2.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo3.Visible = false
script.Parent.Parent.UpdateLog.ViewportFrame.Visible = false
script.Parent.Parent.CONTROLS.Visible = true
end
end)
wait wdym
I mean remove half
which parts??
the ones that are supposed to disappear for both?
put on a new script yes? local or not?
Local for sure
You said that half doesn't work
Just stay working stuff here
And put part on other script
That not working
what i mean by that is, when i press E, the play button ,updates button, and controls button are to disappear until i repress E (E makes the gui for controls appear)
You mean when you press e it appears again
yea
Can u send video or more info
yea one min ill record a video
I'll try
** You are now Level 2! **
thats the video
Why i cant open this file
how about now?
About it
nvm it just did same thing
Ye
So you said that console appears and dissapears on menu
And move mouse jn first person?
In*
so its a main menu gui and it has a play, updates, and controls buttons the only one which is clickable is the play button because when you spawn in, it is place where ur cursor is
updates is keybinded to U
and controls is keybinded to O
but they both disappear when u click play which is good but basically the issue im having is that when you click O, the controls is supposed to appear and then the buttons disappear until you exit 'controls' by pressing O again - it only does half the job, since you press O and then the controls appear but the issue is that you can still see the buttons and when you press O nothing happens, but if you press any other button then controls disappears
so thats why i say it half works , cus it only does half of what i was wanting it to do
That's what i already mean to
Replace script
And rewrite it
So csn u send me your script
I can place a code here
Imma judt looking at it and fix it
this is full script for updates button
u mean send as in copy and paste here?
UPDATES script:
local UI = game:GetService("UserInputService")
UI.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.U then
script.Parent.Visible = false
script.Parent.Parent.TextButton.Visible = false
script.Parent.Parent.UpdateLog.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo1.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo2.Visible = true
script.Parent.Parent.UpdateLog.UpdateLoginfo3.Visible = true
script.Parent.Parent.UpdateLog.ViewportFrame.Visible = true
script.Parent.Parent.CONTROLS.Visible = false
else
script.Parent.Visible = true
script.Parent.Parent.TextButton.Visible = true
script.Parent.Parent.UpdateLog.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo1.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo2.Visible = false
script.Parent.Parent.UpdateLog.UpdateLoginfo3.Visible = false
script.Parent.Parent.UpdateLog.ViewportFrame.Visible = false
script.Parent.Parent.CONTROLS.Visible = true
end
end)
It will really destroy your game
CONTROLS script:
local UI = game:GetService("UserInputService")
UI.InputBegan:Connect(function(key)
if key.KeyCode == Enum.KeyCode.O then
script.Parent.Visible = false
script.Parent.Parent.TextButton.Visible = false
script.Parent.Parent.controls.Visible = true
script.Parent.Parent.controls.frame1.Visible = true
script.Parent.Parent.controls.control1.Visible = true
script.Parent.Parent.controls.control2.Visible = true
script.Parent.Parent.controls.control3.Visible = true
script.Parent.Parent.Updates.Visible = false
else
script.Parent.Visible = true
script.Parent.Parent.TextButton.Visible = true
script.Parent.Parent.controls.Visible = false
script.Parent.Parent.controls.frame1.Visible = false
script.Parent.Parent.controls.control1.Visible = false
script.Parent.Parent.controls.control2.Visible = false
script.Parent.Parent.controls.control3.Visible = false
script.Parent.Parent.Updates.Visible = true
end
end)
disable reset?
how?
What about script.Parent.Visible = false
Make a localscript inside
StarterGui
Game:GetService("StarterGui"):SetCore("ResetButtonCallBack",false)
It will optomise your scripts
Ye type it
ok i will
isnt that a bad thing?
What?
i dont trust that one, looks dodgy
where would i use inputended
ive only been scripting for about a week i am so sorry if i am supposed to know this by now
between locals and stuff?
um
I can try to test in rb studio
Imma make a gui and type your script
Then recover it
Script.parent.Controls.Enabled = false
-Stroke
Script.parent.YouKnow
Did u put that
Make it easier
Do stroke without space
It will look easier
i dont know what a stroke is can you show me an example?
I already showed
like, in a script example
You put 1 space between second bool
I mean
Script.parent.Controls.Enabled = false
-Space(Mistake)
Script.parent.Console2.Visible = true
Optimizing
i mean i guess i do it
Script.Parent.Controls.Enabled = true
Script.parent.Controls2.Enabled = true
In my game it will take less game
a lot of my scripts have gaps but idk why i put them there just looks better tbh
Ok
more organised i guess
So now i will starting makeing a gui
i can upload my gui to roblox, right
** You are now Level 3! **
?
Sure
ok
Make a folder and send
yes
And your nickname
Http_BlueGamer
i think its the only thing ive ever uploaded
I will find you in roblox studio
Sometimes im smarter than i think
I will find your model by your nick instesd of searchjng your inventory
oh ok
go to my inventory, then to models, and it would be the first one
this is what my gui looks like
ignore green bar, thats stamina gui
I cant find your nickname
Republish your models
Roblox
Http_BlueGamer is one of the millions creating and exploring the endless possibilities of Roblox. Join Http_BlueGamer on Roblox and explore together!Hi 👋 My name is #### Blue Gamer,or Any of them words to you. You may be wondering,am I related to OmqBlueNoscoper or am I him? Correct,I am his new account,I most prefer to be called blue or ##### T...
it is in my inventory. first model
This item is not for sale
so basically , the most important fix i need for the gui right now is that when you press the keybind for EITHER updates or controls, they will make the buttons disappear
oh ok one sec let me chec kit
You forgor to make it publish ☠️
whats wrong with it?
You need to change font
huh?
When you hover mouse to button it changes font
it doesnt for me...
Really hard to look which hotkey to open a gui for the first time
Ok
So
Now i need model
for me it just makes it slightly brighter on the edges
and dimmer around the letters
when i hover over
Forger ☠️
oh ok
how do i give model in another way??
Publish it
i just tried and it didnt work remember
Cool
what about publish as plugin?
Bruh
sorry was i supposed to click that first...
I dont wanna ask how you publish it
Roblox is a global platform that brings people together through play.
ok now its publish my bad sorry ive never uploaded anything before
Did u use distrivute on marketplace
Very bad
what why
whaaaaaaaat
So i make a hotkeys
** You are now Level 8! **
☠️☠️☠️☠️
hm ok
** You are now Level 4! **
It works for you because ur owner of this model and it already clained at your inventory
it worked..
it installed but idk how u insert them
Br
o i just figured out how
K
God
doesnt work :/
i thought it would work lol
I d k
Of course
Bruh
will i lose my progress?
thank god
why is that?
hahaha why??
yeah
Or you fixed that
O
ok soo i wonder if it DID autosave
Ye
so now how do i publish properly
RBclick to Gui - Save To Roblox - Distribute to marketplace
u said distribute to marketplace is bad
YEES
its gettable aswell
Finally
but what was the difference?
Im waiting for it 4 no 5 houndreds years
Only on Oklahama
HAHHA
I finnaly get it
Kids in my basem... helps me to solve this porblem
hahahahah
heres the camera that goes with gui
Roblox is a global platform that brings people together through play.
yea but it goes with the menu...
script might not work without it + if you are going to remake the script, you would need the camera for the script to be accurate for me too
i almost forgot too lol
LOL
thnx i didnt make it myself.
Uis dont work

☠️
not clickable no
Scary
Ok
Not working
Click works but hotkeys not
are all the scripts there??
Ye i think
lol must just take time to load
I can walk during menu
I found very interesting thing
When you're in menu,you can tap any button and then console panel will close
Looks correctly but
Idk whats the problem
So now i will upgr it
console panel is what
its weird
because
when u press any key, the controls and update closes
i dont understand it either
oh i just realised
** You are now Level 5! **
I will remake
now this is weird
This gui
the camera, for some weird reason, wont let me move
Theres alot od erroes
oh
Errors
Finished
Roblox is a global platform that brings people together through play.
Rember
ayy
That's all for now
ill see how well it work 1 sec
I added some effects like color change,border
I fixed something
Like now buttons fixed
And J button close Console and Controls
And gets back to main menu
Yes
and it works fine for me but doesnt work when i upload idk why
how do i get it compatible with this new gui?
so like before u click play you see through the camera like before
i dont know what you mean
Everyt fine?
oh
nope
I also add border animation appearing and dissapeaeing
oh
I perfect optimised for mobile or gamepad
I forgor add camera?
so like
You can get it back
how
Ye
OH i see
Forgot about xamera
you have the camera in the GUI
Ye
all i gotta do is insert it lol
ty bro
But rember and do not forgor it! 🤐
I have kids in my basement 🍆💀
ONLY in Ohio ☠️☠️
lol