I'm wondering if this is set up correctly? The functionality of this script would be when a user pushes a button, they're kicked from the server. I know you can do this easily another way, I just need help with remote functions.
--In LocalScript
local player = game.Players.LocalPlayer.Name
script.Parent.MouseButton1Down:connect(function() -- Lets say the scripts in a textbutton
game.Workspace.RemoteFunction:InvokeServer(player)
end)
--In ServerScript
local rf = Instance.new("RemoteFunction")
rf.Parent = game.Workspace
rf.Name = "RemoteFunction"
function rf.OnServerInvoke(player)
game.Players[player]:Kick("You kicked yourself")
end

3 comments
For lines 10 and 11, you could just do local rf = workspace:WaitForChild("RemoteFunction"). Also, I'd use a RemoteEvent because you're not returning anything.
Thank you for answering, but I just wanted to know how (if possible) to carry a variable from the client script over to the server script. Kicking the client isn't the purpose of the actual script I'm creating.
Actually, you DO need OnServerInvoke on the client if you're expecting information being sent to the client from the invocation of the server (OnClientInvoke for client to server). With what the asker said, that client variable was warranted, whatever the first argument of that function is it will always be the player value.