I know about KeyDowns.
function onKeyDown(Key) key = key: lower() if key == "c" then
But how would you make it so players can enter a key from a GUI, and then that'll be the key for the function?
I know about KeyDowns.
function onKeyDown(Key) key = key: lower() if key == "c" then
But how would you make it so players can enter a key from a GUI, and then that'll be the key for the function?
I don't think you really know what you're talking about.. But I'll explain to you the functions capability..
Player = game.Players.LocalPlayer -- Up to the player to trigger
mouse = Player:GetMouse() -- Finding the players mouse.
function onKeyDown(Key) -- onKeyDown could be named anything... It's a function
key = key:lower() -- Defining the key
if key == "c" then -- making a statement
end -- where the function ends
I believe this should be a localscript inside of starterGUI.. Under the statement you can insert anything you want if you wanted to destroy the parent you'd do
script.Parent:Destroy()
And what that does is remove it from your sight. It will happen when you press "c". Now you should know what a function is. You can't necessarily change a script with another script. But what you can do is store a value inside of the player that will change when the GUI is pressed, so you can change the key. Make a statement, then compare it to the value and connect it!
What I mean is TexBox input. 27 values (one for each letter) feels weird. I might even need to make more for the symbols.
Can't I say something like "key == (script.Parent.PlayerGUI.KeyChoice.Text)"?
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Take a closer look at your code.