Answers for "roblox key pressed script"

Lua
2

roblox key pressed script

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
	 
mouse.KeyDown:connect(function()
	    print("Pressed a key.")
end)
Posted by: Guest on September-15-2020
0

roblox key pressed script

local UserInputService = game:GetService("UserInputService")
local Key = Enum.KeyCode.WhateverKey

UserInputService.InputBegan:Connect(function(InputObject, GameProcessedEvent)
    if GameProcessedEvent then return end
    if InputObject.KeyCode = Key then
      print("Player pressed "..InputObject.KeyCode)
    end
end)
Posted by: Guest on June-15-2021

Browse Popular Code Answers by Language