Cannot implicitly convert type `int' to `byte'. An explicit conversion exists (are you missing a cast?)

PhotonNetwork.CreateRoom(hostName, new RoomOptions()
{

            maxPlayers = maxPlayers[players],           <------------Line of the error
            isVisible = true,
            isOpen = true,
            customRoomProperties = roomOption,
            cleanupCacheOnLeave = true,
            customRoomPropertiesForLobby = properties
        }, null);
    }

,

There is not enough code here to give an ‘accurate’ response. We’d need to know the variable types. Somewhere in that line, your attempting to convert something you’ve set as type int, into something you’ve set as type byte.

maxPlayers is of byte type in the class RoomOptions. You can use the Convert class to turn it into a type.

maxPlayers = System.Convert.ToByte(maxPlayers[players]),