How to kick a player

Hi, i just made a script to kick a player from room if player name equal the value and click button he will be kicked out , I’m using Photon

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class LeaveCurrentMatch : MonoBehaviour
{
    public GameObject playerName;
    public void OnClick_LeaveMatch()
    {
        PhotonNetwork.LeaveRoom();
        PhotonNetwork.LoadLevel(0);
    }

    public void Kick(PhotonPlayer kick)
    {
        InputField inputField = playerName.GetComponent<InputField>();
        string value = inputField.text;
        PhotonNetwork.playerName = value;
        PhotonNetwork.CloseConnection(kick);
    }
}

Any help please

With what? You haven’t given any indication of the problem you’re facing.

Seeing how this is part of Photon, you’ll probably have better luck asking in a photon forum or Q&A section.

How I handled the room master’s “kick” feature long ago, was a RPC call to the room member’s client to leave the room. You could reasonably put in a vote-to-kick feature using custom room properties. But this was like, 2 years ago, best to check if Photon has included a built-in way to do this by now.