Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a text box that once a letter is placed in it. It will be recognized once pressed?

Asked by 4 years ago

Like the title said I'm trying to make a text box a player can type in. This player will specifically be able to type a letter into it and once they do they will be able to use in game. As in when the player does press the button that is equaled to the button the game will detect it. Though I'm not sure how to do this. I've seen some examples. One example is Strucid. In Strucid your able to exactly what I just said. Any help will be very appreciated. This is my attempt.

Local Script

local keybindbox = script.Parent
local Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")




UIS.InputBegan:Connect(function(Input,gpe)
    local T = keybindbox.Text
    if Input.KeyCode == Enum.KeyCode.T and not gpe then
        print("Player pressed whatever was in keybindbox")
    end
end)

1 answer

Log in to vote
0
Answered by 4 years ago

Hmm, Im sorta new to this but I'll try.

local keybindbox = script.Parent
local Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(Input)
    local Pressed = Input.KeyBind
    if Pressed == Enum.KeyCode..keybindbox.Text then
        print("Something")
    end
end)

This could not really work but give it a try, you never know!

0
I put two dots after KeyCode roblox136393 32 — 4y
0
No sorry it didn't work. I got this error: 12:00:28.167 - KeyBind is not a valid member of InputObject Bl_ueHistory 94 — 4y
0
Yea, only put one. Sensei_Developer 298 — 4y
0
Oof roblox136393 32 — 4y
Ad

Answer this question