local plr = game.Players.LocalPlayer
local char = plr.Character
local UIS = game:GetService("UserInputService")
local Mouse = plr:GetMouse()
---------------------------------------------
local RP = game:GetService("ReplicatedStorage")
local Remote = RP.FireBallRemote
--------------------------------------
local Debounce = true
local Key = "Z"
local ButtonDown = false
UIS.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
local KeyPressed = Input.KeyCode if KeyPressed == Enum.KeyCode[Key] and Debounce and char then
Debounce = false
ButtonDown = true
Remote:FireServer(ButtonDown, Mouse.Hit,UIS)
print("fired")
end
end)
✓ ANSWER ACCEPTED
The remote event wont fire and i have no idea how to fix this?
1 answer
✓ Accepted answer
Client
local plr = game.Players.LocalPlayer
local char = plr.Character
local UIS = game:GetService("UserInputService")
local Mouse = plr:GetMouse()
---------------------------------------------
local RP = game:GetService("ReplicatedStorage")
local Remote = RP.FireBallRemote
--------------------------------------
local Debounce = true
local Key = "Z"
local ButtonDown = false
UIS.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
local KeyPressed = Input.KeyCode if KeyPressed == Enum.KeyCode[Key] and Debounce and char then
Debounce = false
ButtonDown = true
Remote:FireServer(ButtonDown, Mouse.Hit,UIS)
print("fired")
end
end)
Server
local UIS = game:GetService("UserInputService")
Remote.OnServerEvent:Connect(function(Player,Down,HitPosition)
-- code here
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
thx i will try this
player is always the first variable in a remote