Kick not properly working?

EDIT: this all works fine. i just had the wrong name for my remove event :man_facepalming:

I’m working on a kick screen for my admins and there seems to be an issue and I can’t figure out whats wrong with it?
Any help will be appreciated.

Error :

Script 'Players.eggspIicit.PlayerGui.adminUi.infoFrame.KICK.LocalScript', Line 2 

This is the LocalScript.

script.Parent.MouseButton1Click:Connect(function()
	game.ReplicatedStorage.Kick:FireServer(script.Parent.Parent.PlayerBox.Text,script.Parent.Parent.ReasonBox.Text)
end)

This is the script in ServerScriptService

game.ReplicatedStorage.KickRequest.OnServerEvent:Connect(function(Player, Reason)
	game.Players:FindFirstChild(Player):Kick("You've been kicked by for "..Reason)
end)

A player argument is implicitly passed when you use :FireServer. Since you’re wanting to kick a player which is not the LocalPlayer, you’ll need to still pass the name, but also define the LocalPlayer so it goes from (Player, string) to (Player, string, string).

game.ReplicatedStorage.KickRequest.OnServerEvent:Connect(function(_, Player, Reason)
	game.Players[Player]:Kick("You've been kicked by for "..Reason)
end)

That still hasn’t changed anything? The issue is still somewhere inside of the LocalScript.
image

Can you please provide the whole output? That message is just telling the line and script which errored, not the error itself.

What’s the full error my man? That only shows where the error is.

Error on my end. My RemoveEvent name had a lowercase k. :man_facepalming::man_facepalming::man_facepalming:
Sorry everyone.