Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I make this work? Script function - print word "A" when key A is pressed

I created a script using service UserInputService so it print A when the key "A" is pressed. However it doesn't work. I tried direct copy and paste but it doesn't work either.

Here it is

local D = game:GetService("UserInputService")

D.InputBegan:Connect(function(input, gameProcessed) if input.KeyCode == Enum.KeyCode.A then print("A") end end)

1 answer

Issue

You are using a serverscript

Fix

Use a localscript

This discussion is preserved as it was. New answers, comments, and votes are closed.