Knock knock
Who's there?
OnServerEvent takes the Player as the first argument, meaning that sending the Player you're trying to kick is a little redundant - If you want to just kick the LocalPlayer, it's simple enough:
Server
local Players = game.Players
local Kick = (Players:GetChildren()[1] or Players.PlayerAdded:wait()).Kick
script.Parent.OnServerEvent:connect(Kick)
Client
workspace.Kick:FireServer()
If you're wondering how the server script works, it simply gets a random player or the first player to join and gets the Kick function from it. Because the OnServerEvent always returns the player who used it, that gets passed straight to Kick and they get booted.
2 comments
It's for an admin script, I wanna be able to go workspace.Kick:FireServer("playername")
Well you don't want to do it from the client, that's for sure.