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

Test if a player presses Enter?

Asked by 9 years ago

I'm making a nature exploration-esque game and I'm inserting text into a GUI and I want to use Enter to advance the text. How would I do it?

Thanks!

0
You would want to use Keydown or UserInputService, we can not make the script for you. M39a9am3R 3210 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Use key:byte()

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

mouse.KeyDown:connect(function(key)
if key:byte() == 13 then --the code for enter is 13
--Advance the text
end
end)

0
I'll try this in a bit connieoop 10 — 9y
0
Didn't work... I'll instead use a TextButton connieoop 10 — 9y
Ad

Answer this question