How Do You Make This Script Work When You Press a Arrow Key? Script:
function OnKeyDown(key) if (key == '') then end end game.Players.LocalPlayer:GetMouse().KeyDown:connect(OnKeyDown)
Thank you!
In a LocalScript:
local UIS = game:GetService("UserInputService") -- What the UIS is, is basically an ear for anything the Users do. Such as: Press a key, Type in chat AND MUCH MUCH MOREEE!~ UIS.InputBegan:connect(function(input) -- If UIS has been fired if input.UserInputType == Enum.UserInputType.Keyboard and input.UserInputState == Enum.UserInputState.Begin then -- If The user is using the keyboard, and Has pressed a key. if input.Keycode == Enum.KeyCode.Down or input.Keycode == Enum.Keycode.Left or input.Keycode == Enum.Keycode.Right or input.Keycode == Enum.Keycode.Up then -- Checks for Left, Right, Up, or Down keys being pressed, if not, moves on. -- CODE HERE :) end end end)