Help With Leaderstat Giver

Hi I need some help with this leaderstat giver. It is supposed to give you 1 Point for clicking the key W. Yet I get these errors


Here Are the scripts
Hiiiiii

Script in ServerScriptService

local UserInputService = game:GetService("UserInputService") 

UserInputService.InputBegan:Connect(function(input) 
	if input.KeyCode == Enum.KeyCode.W then
		local rs = game:GetService("ReplicatedStorage")
		
		local givepoint = rs:FindFirstChild("GivePoint")
		
		givepoint:FireServer()
	end
end)

Localscript in StarterGui

local rs = game:GetService("ReplicatedStorage")

local givepoint = rs:FindFirstChild("GivePoint")

givepoint.OnServerEvent:Connect(function(player)
	player.leaderstats.Points.Value = player.leaderstats.Points.Value + 1	
end)

Thanks For your help (The script in workspace is the leadersta1 script it works)

It’s because your RemoteEvent is named “RemoteEvent.”

From what i see is that you’re firing the server inside a server-script and trying to receive that signal of the remotevent on a localscript, this wouldn’t work in the first place, you’d need to use the FireClient function.

FireServer: Client => Server

FireClient: Server => Client

Edit: Rename your RemoteEvent to: GivePoint also the UserInputService is only available for the client as it not useable for the server