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

How can I make an on screen keyboard that displays the typed word on a surfacegui?

Asked by 2 years ago

Hello, back again, this time to ask how I can make a keyboard in Roblox. I'm trying to make a keyboard that one of the players can use to type something onto a surface gui. and then store that word onto the server. Here's what I have so far.

for i,v in pairs(game.StarterGui.ScreenGui.keyB1:GetChildren()) do --Doing a loop for all children of the frame
    if string.sub(v.Name,1,6) == "Letter" then --Looking if the object's name starts with "Number". Check string.sub method(?) for further info.
        v.MouseButton1Click:Connect(function() --Basic click connection.
            game.Workspace.BlueTeamGameRoom.BlueGameBoard.Board.SurfaceGui.TextBox.Text = game.Workspace.BlueTeamGameRoom.BlueGameBoard.Board.SurfaceGui.TextBox.Text .. v.Text --Adding text to textbox's text
        end)
    end
end

The code I'm using is based on a code I found for a number keypad so I think the script might not be exactly how it should be. I looked for other tutorials for an on screen keyboard (osk) but i couldn't find anything.

Answer this question