-- Services
local replicatedStorage = game:GetService("ReplicatedStorage")
local userInputService = game:GetService("UserInputService")
-- Variables
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local remoteEvent = replicatedStorage.ElementsRemoteEvents.Fire.FireballRain.FireballRainRemoteEvent
local playerMouse = player:GetMouse()
-- Settings
local debounce = true
local key = '1'
userInputService.InputBegan:Connect(function(input, isTyping)
if isTyping then return end
local keyPressed = input.KeyCode
if keyPressed == Enum.KeyCode[key] and debounce and character then
debounce = false
remoteEvent:FireServer(playerMouse.Hit)
wait(1)
debounce = true
end
end)
I already gave you the link to the Enum.KeyCode webpage above; it’s on the Developer Hub. You could have found what you needed there, or searched it yourself.